as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
跳转到主要内容
A builder class for creating and importing asymmetric keys. This class provides methods to configure key properties and generate or import both public and private keys.

Extends

  • BaseCryptoClass

Extended by

Constructors

new AsymmetricKeyBuilder()

new AsymmetricKeyBuilder(): AsymmetricKeyBuilder

Returns

AsymmetricKeyBuilder

Methods

buildGenerated()

buildGenerated(): Promise<PrivateKey>
Build a new private key based on the configured properties.

Throws

  • InvalidArgumentError If the chosen key size or the key itself is invalid.

Returns

Promise<PrivateKey> Promise<PrivateKey> A promise that resolves to the generated private key.

buildPrivateFromDer()

buildPrivateFromDer(der: ArrayBuffer): Promise<PrivateKey>
Import a private key from a DER-encoded blob. The imported key will inherit the properties (algorithm, purposes, exportability) set on this builder.

Parameters

der
ArrayBuffer The DER-encoded private key in PKCS#8 format.

Throws

  • InvalidArgumentError If the provided key is invalid.

Returns

Promise<PrivateKey> Promise<PrivateKey> A promise that resolves to the imported private key.

buildPublicFromDer()

buildPublicFromDer(der: ArrayBuffer): Promise<PublicKey>
Import a public key from a DER-encoded blob. The imported key will inherit the properties (algorithm, purposes) set on this builder.

Parameters

der
ArrayBuffer The DER-encoded public key in SubjectPublicKeyInfo format.

Throws

  • InvalidArgumentError If the provided key is invalid.

Returns

Promise<PublicKey> Promise<PublicKey> A promise that resolves to the imported public key.
最后修改于 2026年8月25日