MCPcopy Create free account
hub / github.com/Effect-TS/effect / KeyWrapPrivateKeyFromFormat

Function KeyWrapPrivateKeyFromFormat

packages/effect/src/Schema.ts:15399–15414  ·  view source on GitHub ↗
(
  format: KeyFormat_.Format<"private", "decode", Data>,
  algorithm: A,
  options?: CryptoKeyOptions
)

Source from the content-addressed store, hash-verified

15397 * @since 4.0.0
15398 */
15399export const KeyWrapPrivateKeyFromFormat = <A extends KeyWrap_.RsaOaep, Data>(
15400 format: KeyFormat_.Format<"private", "decode", Data>,
15401 algorithm: A,
15402 options?: CryptoKeyOptions
15403): decodeTo<KeyWrapPrivateKey<A>, Codec<Data>> =>
15404 cryptoKeyFromFormat(
15405 "KeyWrapPrivateKeyFromFormat",
15406 KeyWrapPrivateKey(algorithm),
15407 format,
15408 (data) =>
15409 KeyFormat_.decodePrivate(format, algorithm, data) as Effect.Effect<
15410 KeyWrap_.PrivateKey<A>,
15411 CryptoError_.CryptoError
15412 >,
15413 options?.allowEncode === true
15414 )
15415
15416// -----------------------------------------------------------------------------
15417// Exit schemas

Callers

nothing calls this directly

Calls 2

cryptoKeyFromFormatFunction · 0.85
KeyWrapPrivateKeyFunction · 0.70

Tested by

no test coverage detected