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

Function AeadKeyFromBytes

packages/effect/src/Schema.ts:14678–14687  ·  view source on GitHub ↗
(
  algorithm: A,
  options?: CryptoKeyOptions
)

Source from the content-addressed store, hash-verified

14676 * @since 4.0.0
14677 */
14678export const AeadKeyFromBytes = <A extends Aead_.Algorithm>(
14679 algorithm: A,
14680 options?: CryptoKeyOptions
14681): decodeTo<AeadKey<A>, Uint8Array> =>
14682 cryptoKeyFromBytes(
14683 "AeadKeyFromBytes",
14684 AeadKey(algorithm),
14685 (bytes) => Aead_.key(algorithm, bytes),
14686 options?.allowEncode === true ? Aead_.toBytes : undefined
14687 )
14688
14689/**
14690 * Schema that decodes an `Aead.Key` from a JWK with `KeyFormat.decodeSecret`.

Callers

nothing calls this directly

Calls 3

cryptoKeyFromBytesFunction · 0.85
AeadKeyFunction · 0.70
keyMethod · 0.65

Tested by

no test coverage detected