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

Function KeyAgreementPrivateKeyFromFormat

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

Source from the content-addressed store, hash-verified

15174 * @since 4.0.0
15175 */
15176export const KeyAgreementPrivateKeyFromFormat = <A extends KeyAgreement_.Algorithm, Data>(
15177 format: KeyFormat_.Format<"private", "decode", Data>,
15178 algorithm: A,
15179 options?: CryptoKeyOptions
15180): decodeTo<KeyAgreementPrivateKey<A>, Codec<Data>> =>
15181 cryptoKeyFromFormat(
15182 "KeyAgreementPrivateKeyFromFormat",
15183 KeyAgreementPrivateKey(algorithm),
15184 format,
15185 (data) =>
15186 KeyFormat_.decodePrivate(format, algorithm, data) as Effect.Effect<
15187 KeyAgreement_.PrivateKey<A>,
15188 CryptoError_.CryptoError
15189 >,
15190 options?.allowEncode === true
15191 )
15192
15193/**
15194 * Type-level representation of {@link KeyWrapKey}.

Callers

nothing calls this directly

Calls 2

cryptoKeyFromFormatFunction · 0.85
KeyAgreementPrivateKeyFunction · 0.70

Tested by

no test coverage detected