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

Function AeadKeyFromFormat

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

Source from the content-addressed store, hash-verified

14701 * @since 4.0.0
14702 */
14703export const AeadKeyFromFormat = <A extends Aead_.Algorithm, Data>(
14704 format: KeyFormat_.Format<"secret", "decode", Data>,
14705 algorithm: A,
14706 options?: CryptoKeyOptions
14707): decodeTo<AeadKey<A>, Codec<Data>> =>
14708 cryptoKeyFromFormat(
14709 "AeadKeyFromFormat",
14710 AeadKey(algorithm),
14711 format,
14712 (data) => KeyFormat_.decodeSecret(format, algorithm, data) as Effect.Effect<Aead_.Key<A>, CryptoError_.CryptoError>,
14713 options?.allowEncode === true
14714 )
14715
14716/**
14717 * Type-level representation of {@link CipherKey}.

Callers

nothing calls this directly

Calls 2

cryptoKeyFromFormatFunction · 0.85
AeadKeyFunction · 0.70

Tested by

no test coverage detected