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

Function SignaturePrivateKeyFromFormat

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

Source from the content-addressed store, hash-verified

14979 * @since 4.0.0
14980 */
14981export const SignaturePrivateKeyFromFormat = <A extends Signature_.Algorithm, Data>(
14982 format: KeyFormat_.Format<"private", "decode", Data>,
14983 algorithm: A,
14984 options?: CryptoKeyOptions
14985): decodeTo<SignaturePrivateKey<A>, Codec<Data>> =>
14986 cryptoKeyFromFormat(
14987 "SignaturePrivateKeyFromFormat",
14988 SignaturePrivateKey(algorithm),
14989 format,
14990 (data) =>
14991 KeyFormat_.decodePrivate(format, algorithm, data) as Effect.Effect<
14992 Signature_.PrivateKey<A>,
14993 CryptoError_.CryptoError
14994 >,
14995 options?.allowEncode === true
14996 )
14997
14998/**
14999 * Type-level representation of {@link KeyAgreementPublicKey}.

Callers

nothing calls this directly

Calls 2

cryptoKeyFromFormatFunction · 0.85
SignaturePrivateKeyFunction · 0.70

Tested by

no test coverage detected