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

Function KeyAgreementPrivateKeyFromBytes

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

Source from the content-addressed store, hash-verified

15146 * @since 4.0.0
15147 */
15148export const KeyAgreementPrivateKeyFromBytes = <
15149 A extends KeyAgreement_.X25519
15150>(algorithm: A, options?: CryptoKeyOptions): decodeTo<KeyAgreementPrivateKey<A>, Uint8Array> =>
15151 cryptoKeyFromBytes(
15152 "KeyAgreementPrivateKeyFromBytes",
15153 KeyAgreementPrivateKey(algorithm),
15154 (bytes) => KeyAgreement_.privateKey(algorithm, bytes),
15155 options?.allowEncode === true ? KeyAgreement_.toBytes : undefined
15156 )
15157
15158/**
15159 * Schema that decodes a `KeyAgreement.PrivateKey` with

Callers

nothing calls this directly

Calls 2

cryptoKeyFromBytesFunction · 0.85
KeyAgreementPrivateKeyFunction · 0.70

Tested by

no test coverage detected