Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
Provides a comprehensive interface for cryptographic operations. This class serves as a central point for accessing various cryptographic functionalities including algorithm retrieval, key generation, and cipher operations.

Constructors

new Crypto()

new Crypto(): Crypto Create a new instance of the Crypto class. Initializes a new Crypto object. This constructor doesn’t take any parameters as it sets up the internal state needed to perform cryptographic operations. Each instance provides access to the full range of cryptographic functionalities.

Returns

Crypto

Methods

getAsymmetricAlgorithmByName()

getAsymmetricAlgorithmByName(name): AsymmetricAlgorithm Get an asymmetric algorithm by name. This function retrieves an asymmetric algorithm by its name.

Parameters

name
string The name of the asymmetric algorithm.

Returns

AsymmetricAlgorithm The requested asymmetric algorithm.

Throws

InvalidArgumentError If the algorithm name is invalid.

getDigestAlgorithmByName()

getDigestAlgorithmByName(name): DigestAlgorithm Get a digest algorithm by name. This function retrieves a digest algorithm based on its name. If the algorithm with the given name is supported, it returns the requested algorithm.

Parameters

name
string The name of the algorithm.

Returns

DigestAlgorithm The requested digest algorithm.

Throws

InvalidArgumentError If the algorithm name is invalid.
Last modified on October 2, 2025