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

Function KeyAgreementPublicKeyFromFormat

packages/effect/src/Schema.ts:15076–15090  ·  view source on GitHub ↗
(
  format: KeyFormat_.Format<"public", "decode", Data>,
  algorithm: A
)

Source from the content-addressed store, hash-verified

15074 * @since 4.0.0
15075 */
15076export const KeyAgreementPublicKeyFromFormat = <A extends KeyAgreement_.Algorithm, Data>(
15077 format: KeyFormat_.Format<"public", "decode", Data>,
15078 algorithm: A
15079): decodeTo<KeyAgreementPublicKey<A>, Codec<Data>> =>
15080 cryptoKeyFromFormat(
15081 "KeyAgreementPublicKeyFromFormat",
15082 KeyAgreementPublicKey(algorithm),
15083 format,
15084 (data) =>
15085 KeyFormat_.decodePublic(format, algorithm, data) as Effect.Effect<
15086 KeyAgreement_.PublicKey<A>,
15087 CryptoError_.CryptoError
15088 >,
15089 true
15090 )
15091
15092/**
15093 * Type-level representation of {@link KeyAgreementPrivateKey}.

Callers

nothing calls this directly

Calls 2

cryptoKeyFromFormatFunction · 0.85
KeyAgreementPublicKeyFunction · 0.70

Tested by

no test coverage detected