Functions
createKeyPairFromBytes
createKeyPairFromBytes(
bytes
,extractable?
):Promise
<CryptoKeyPair
>
Given a 64-byte Uint8Array
secret key, creates an Ed25519 public/private key pair for use with
other methods in this package that accept CryptoKey
objects.
Parameters
Parameter | Type | Description |
---|---|---|
bytes | ReadonlyUint8Array | 64 bytes, the first 32 of which represent the private key and the last 32 of which represent its associated public key |
extractable? | boolean | Setting this to true makes it possible to extract the bytes of the private key using the crypto.subtle.exportKey() API. Defaults to false . |
Returns
Promise
<CryptoKeyPair
>