as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
跳转到主要内容
Represents a public key used in asymmetric cryptography. Public keys are typically generated using the PrivateKey.getPublicKey or AsymmetricKeyBuilder.buildPublicFromDer methods. This class also provides methods to export and check the properties of public keys.

Extends

  • BaseCryptoClass

Constructors

new PublicKey()

new PublicKey(): PublicKey

Returns

PublicKey

Methods

exportDer()

exportDer(): Promise<ArrayBuffer>
Export the public key as a DER-encoded blob. The public key is exported in SubjectPublicKeyInfo format as described in RFC 5280, Section 4.1.

Throws

  • AccessDeniedError If the key is not exportable.

Returns

Promise<ArrayBuffer> Promise<ArrayBuffer> A promise that resolves to an ArrayBuffer containing the DER-encoded key.

hasPurpose()

hasPurpose(purpose: KeyPurpose): boolean
Check if a specific purpose is enabled for this public key.

Parameters

purpose
KeyPurpose The purpose to check.

Throws

  • InvalidArgumentError If the argument is not a valid purpose.

Returns

boolean boolean True if the specified purpose is enabled, false otherwise.
最后修改于 2026年8月25日