WebCryptoP256.createKeyPairECDH
Generates an ECDH P256 key pair for key agreement that includes:
- a
privateKey
of typeCryptoKey
- apublicKey
of typePublicKey.PublicKey
Imports
Named
import { WebCryptoP256 } from 'ox'
Examples
import { WebCryptoP256 } from 'ox'
const { publicKey, privateKey } = await WebCryptoP256.createKeyPairECDH()
{ privateKey: CryptoKey {}, publicKey: { x: 59295962801117472859457908919941473389380284132224861839820747729565200149877n, y: 24099691209996290925259367678540227198235484593389470330605641003500238088869n, prefix: 4, }, }
Definition
function createKeyPairECDH(
options?: createKeyPairECDH.Options,
): Promise<createKeyPairECDH.ReturnType>
Source: src/core/WebCryptoP256.ts
Parameters
options
- Type:
createKeyPairECDH.Options
- Optional
Options for creating the key pair.
options.extractable
- Type:
boolean
- Optional
A boolean value indicating whether it will be possible to export the private key using globalThis.crypto.subtle.exportKey()
.
Return Type
The key pair.
Promise<createKeyPairECDH.ReturnType>