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

Function KeyWrapPublicKeyFromFormat

packages/effect/src/Schema.ts:15328–15342  ·  view source on GitHub ↗
(
  format: KeyFormat_.Format<"public", "decode", Data>,
  algorithm: A
)

Source from the content-addressed store, hash-verified

15326 * @since 4.0.0
15327 */
15328export const KeyWrapPublicKeyFromFormat = <A extends KeyWrap_.RsaOaep, Data>(
15329 format: KeyFormat_.Format<"public", "decode", Data>,
15330 algorithm: A
15331): decodeTo<KeyWrapPublicKey<A>, Codec<Data>> =>
15332 cryptoKeyFromFormat(
15333 "KeyWrapPublicKeyFromFormat",
15334 KeyWrapPublicKey(algorithm),
15335 format,
15336 (data) =>
15337 KeyFormat_.decodePublic(format, algorithm, data) as Effect.Effect<
15338 KeyWrap_.PublicKey<A>,
15339 CryptoError_.CryptoError
15340 >,
15341 true
15342 )
15343
15344/**
15345 * Type-level representation of {@link KeyWrapPrivateKey}.

Callers

nothing calls this directly

Calls 2

cryptoKeyFromFormatFunction · 0.85
KeyWrapPublicKeyFunction · 0.70

Tested by

no test coverage detected