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

Function CipherKeyFromFormat

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

Source from the content-addressed store, hash-verified

14789 * @since 4.0.0
14790 */
14791export const CipherKeyFromFormat = <A extends Cipher_.Algorithm, Data>(
14792 format: KeyFormat_.Format<"secret", "decode", Data>,
14793 algorithm: A,
14794 options?: CryptoKeyOptions
14795): decodeTo<CipherKey<A>, Codec<Data>> =>
14796 cryptoKeyFromFormat(
14797 "CipherKeyFromFormat",
14798 CipherKey(algorithm),
14799 format,
14800 (data) =>
14801 KeyFormat_.decodeSecret(format, algorithm, data) as Effect.Effect<Cipher_.Key<A>, CryptoError_.CryptoError>,
14802 options?.allowEncode === true
14803 )
14804
14805/**
14806 * Type-level representation of {@link SignaturePublicKey}.

Callers

nothing calls this directly

Calls 2

cryptoKeyFromFormatFunction · 0.85
CipherKeyFunction · 0.70

Tested by

no test coverage detected