as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
Ring
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
感谢您的访问。此页面目前仅提供英语版本。我们正在开发中文版本。谢谢您的理解。

SymmetricKey

Represents a symmetric key used for cryptographic operations. Symmetric keys are typically generated using a . This class also provides methods to export and check the properties of symmetric keys.

Extends

  • BaseCryptoClass

Constructors

new SymmetricKey()

new SymmetricKey(): SymmetricKey

Returns

SymmetricKey

Methods

exportRaw()

exportRaw(): Promise<ArrayBuffer>

Export the symmetric key as raw bytes. This method should only be called on keys that are marked as exportable.

Throws

  • If the key is not exportable.

Returns

Promise<ArrayBuffer>

Promise A promise that resolves to the raw key bytes.


hasPurpose()

hasPurpose(purpose: KeyPurpose): boolean

Check if a particular purpose is enabled for this key.

Parameters

purpose

KeyPurpose

A key purpose to check.

Throws

  • If the argument is not a valid purpose.

Returns

boolean

boolean true if the purpose is enabled for this key, false otherwise.


Last updated: Jul 22, 2026