Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazonアプリストア
Ring
AWS
ドキュメント
Support
Contact Us
My Cases
開発
設計と開発
公開
リファレンス
サポート
アクセスいただきありがとうございます。こちらのページは現在英語のみのご用意となっております。順次日本語化を進めてまいりますので、ご理解のほどよろしくお願いいたします。

PrivateKey

Represents a private key used in asymmetric cryptography. Private keys are typically generated using an or any of the subclasses inheriting from it. This class also provides methods to export and check the properties of private keys.

Extends

  • BaseCryptoClass

Constructors

new PrivateKey()

new PrivateKey(): PrivateKey

Returns

PrivateKey

Methods

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 A promise that resolves to an ArrayBuffer containing the DER-encoded key.


getPublicKey()

getPublicKey(): PublicKey

Derive the corresponding public key from this private key.

Throws

  • If the contents of the private key are invalid.

Returns

PublicKey

PublicKey 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

  • If the argument is not a valid purpose.

Returns

boolean

boolean True if the specified purpose is enabled, false otherwise.


Last updated: Jul 22, 2026