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

Function MacKeyFromFormat

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

Source from the content-addressed store, hash-verified

14621 * @since 4.0.0
14622 */
14623export const MacKeyFromFormat = <A extends Mac_.Algorithm, Data>(
14624 format: KeyFormat_.Format<"secret", "decode", Data>,
14625 algorithm: A,
14626 options?: CryptoKeyOptions
14627): decodeTo<MacKey<A>, Codec<Data>> =>
14628 cryptoKeyFromFormat(
14629 "MacKeyFromFormat",
14630 MacKey(algorithm),
14631 format,
14632 (data) => KeyFormat_.decodeSecret(format, algorithm, data) as Effect.Effect<Mac_.Key<A>, CryptoError_.CryptoError>,
14633 options?.allowEncode === true
14634 )
14635
14636/**
14637 * Type-level representation of {@link AeadKey}.

Callers

nothing calls this directly

Calls 2

cryptoKeyFromFormatFunction · 0.85
MacKeyFunction · 0.70

Tested by

no test coverage detected