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

Function KeyWrapKeyFromFormat

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

Source from the content-addressed store, hash-verified

15260 * @since 4.0.0
15261 */
15262export const KeyWrapKeyFromFormat = <A extends KeyWrap_.AesKw, Data>(
15263 format: KeyFormat_.Format<"secret", "decode", Data>,
15264 algorithm: A,
15265 options?: CryptoKeyOptions
15266): decodeTo<KeyWrapKey<A>, Codec<Data>> =>
15267 cryptoKeyFromFormat(
15268 "KeyWrapKeyFromFormat",
15269 KeyWrapKey(algorithm),
15270 format,
15271 (data) =>
15272 KeyFormat_.decodeSecret(format, algorithm, data) as Effect.Effect<KeyWrap_.Key<A>, CryptoError_.CryptoError>,
15273 options?.allowEncode === true
15274 )
15275
15276/**
15277 * Type-level representation of {@link KeyWrapPublicKey}.

Callers

nothing calls this directly

Calls 2

cryptoKeyFromFormatFunction · 0.85
KeyWrapKeyFunction · 0.70

Tested by

no test coverage detected