Extends
BaseCryptoClass
Constructors
new PrivateKey()
new PrivateKey(): PrivateKey
Returns
PrivateKeyMethods
exportDer()
exportDer(): Promise<ArrayBuffer>
Export the private key as a DER-encoded blob.
Private keys are exported in PKCS#8 format.
Returns
Promise<ArrayBuffer>
Promise<ArrayBuffer> A promise that resolves to an ArrayBuffer containing the DER-encoded key.
getPublicKey()
getPublicKey(): PublicKeyDerive the corresponding public key from this private key.
Throws
InvalidArgumentErrorIf the contents of the private key are invalid.
Returns
PublicKeyPublicKey The derived public key.
hasPurpose()
hasPurpose(purpose: KeyPurpose): boolean
Check if a specific purpose is enabled for this private key.
Parameters
purpose
KeyPurpose The key purpose to check.Throws
InvalidArgumentErrorIf the argument is not a valid purpose.
Returns
boolean
boolean True if the specified purpose is enabled, false otherwise.
