Interface ICrypto
interface ICrypto
Extends com.amazon.apmf.IStandard
Methods
getSupportedDigestAlgorithms()
List supported digest algorithms. This function returns an array containing all supported digest algorithms. Users can iterate over this array to obtain information about each supported digest algorithm.IDigestAlgorithm*[]getSupportedDigestAlgorithms()
Returns
IDigestAlgorithm*[]
An array of supported digest algorithms.
getDigestAlgorithmByName()
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.IDigestAlgorithm*getDigestAlgorithmByName(stringname)
Parameters
name
string — Required
The name of the algorithm.
Returns
IDigestAlgorithm*
the requested algorithm
Throws
NotSupportedError— if the algorithm is not supported.
getSupportedSymmetricAlgorithms()
List supported symmetric algorithms. This function returns an array containing all supported symmetric algorithms. Users can iterate over this array to obtain information about each supported digest algorithm.ISymmetricAlgorithm*[]getSupportedSymmetricAlgorithms()
Returns
ISymmetricAlgorithm*[]
An array of supported symmetric algorithms.
getSymmetricAlgorithmByName()
Get a symmetric algorithm by name. This function retrieves a symmetric algorithm based on its name. The name parameter specifies the name of the algorithm to retrieve. If the specified algorithm is supported, it returns an object representing the requested algorithm.ISymmetricAlgorithm*getSymmetricAlgorithmByName(stringname)
Parameters
name
string — Required
The name of the symmetric algorithm to retrieve.
Returns
ISymmetricAlgorithm*
An object representing the requested symmetric algorithm.
Throws
NotSupportedError— if the specified algorithm is not supported.
makeSymmetricKeyBuilder()
Make an object that can be used to build symmetric keys. This function creates an instance of an object that can be used to build symmetric keys.ISymmetricKeyBuilder*makeSymmetricKeyBuilder()
Returns
ISymmetricKeyBuilder*
A new ISymmetricKeyBuilder object.
makeGcmCipherContextBuilder()
Make an object for building a cipher context in GCM mode. This function creates an instance of an object that can be used to build a cipher context in GCM mode. It takes an ISymmetricAlgorithm object as a parameter specifying the algorithm to use.IGcmContextBuilder*makeGcmCipherContextBuilder(ISymmetricAlgorithm*alg)
Parameters
alg
ISymmetricAlgorithm* — Required
An ISymmetricAlgorithm object representing the algorithm to use.
Returns
IGcmContextBuilder*
A new IGcmContextBuilder object.
makeCbcCipherContextBuilder()
Make an object for building a cipher context in CBC mode. This function creates an instance of an object that can be used to build a cipher context in CBC mode. It takes an ISymmetricAlgorithm object as a parameter specifying the algorithm to use.ICbcContextBuilder*makeCbcCipherContextBuilder(ISymmetricAlgorithm*alg)
Parameters
alg
ISymmetricAlgorithm* — Required
An ISymmetricAlgorithm object representing the algorithm to use.
Returns
ICbcContextBuilder*
A new ICbcContextBuilder object.
makeCtrCipherContextBuilder()
Make an object for building a cipher context in CTR mode. This function creates an instance of an object that can be used to build a cipher context in CTR mode. It takes an ISymmetricAlgorithm object as a parameter specifying the algorithm to use.ICtrContextBuilder*makeCtrCipherContextBuilder(ISymmetricAlgorithm*alg)
Parameters
alg
ISymmetricAlgorithm* — Required
An ISymmetricAlgorithm object representing the algorithm to use.
Returns
ICtrContextBuilder*
A new ICtrContextBuilder object.
getAsymmetricAlgorithmByName()
Get an asymmetric algorithm by name. This function retrieves an asymmetric algorithm by its name.IAsymmetricAlgorithm*getAsymmetricAlgorithmByName(stringname)
Parameters
name
string — Required
The name of the algorithm.
Returns
IAsymmetricAlgorithm*
The requested algorithm.
Throws
NotSupportedError— if the algorithm is not supported.
getSupportedSignatureAlgorithms()
List supported signature algorithms. This function returns an array of supported signature algorithms.IAsymmetricAlgorithm*[]getSupportedSignatureAlgorithms()
Returns
IAsymmetricAlgorithm*[]
An array of supported signature algorithms.
makeSignatureContextBuilder()
Make an object for building a signature context. This function creates an object that can be used to build a signature context.ISignatureContextBuilder*makeSignatureContextBuilder()
Returns
ISignatureContextBuilder*
An object for building a signature context.
getSupportedEccCurves()
List supported elliptic-curve cryptography curves. This function returns an array of supported elliptic-curve cryptography curves.IEccCurve*[]getSupportedEccCurves()
Returns
IEccCurve*[]
An array of supported elliptic-curve cryptography curves.
getEccCurveByName()
Get an elliptic-curve cryptography curve by name. This function retrieves an elliptic-curve cryptography curve by its name.IEccCurve*getEccCurveByName(stringname)
Parameters
name
string — Required
The name of the curve.
Returns
IEccCurve*
The requested curve.
Throws
NotSupportedError— if the curve is not supported.
getWrappingSchemeByName()
Get a wrapping scheme by name. This function retrieves a wrapping scheme by its name.IWrappingScheme*getWrappingSchemeByName(stringname)
Parameters
name
string — Required
The name of the wrapping scheme.
Returns
IWrappingScheme*
The requested wrapping scheme.
Throws
NotSupportedError— if the wrapping scheme is not supported.
makeAsymmetricKeyBuilder()
Make an asymmetric key builder. This function creates an object that can be used to build asymmetric keys.IAsymmetricKeyBuilder*makeAsymmetricKeyBuilder()
Returns
IAsymmetricKeyBuilder*
The asymmetric key builder object.
getSupportedAsymmetricCipherAlgorithms()
Get supported asymmetric cipher algorithms. This function retrieves a list of supported asymmetric cipher algorithms.IAsymmetricAlgorithm*[]getSupportedAsymmetricCipherAlgorithms()
Returns
IAsymmetricAlgorithm*[]
An array of supported asymmetric cipher algorithms.
makeAsymmetricCipherContextBuilder()
Make an object for building cipher contexts using asymmetric cryptography. This function creates an object that can be used to build cipher contexts using asymmetric cryptography.IAsymmetricCipherContextBuilder*makeAsymmetricCipherContextBuilder(IAsymmetricAlgorithm*alg)
Parameters
alg
IAsymmetricAlgorithm* — Required
The asymmetric algorithm to be used.
Returns
IAsymmetricCipherContextBuilder*
The asymmetric cipher context builder object.
makeRsaOaepCipherContextBuilder()
Make an object for building RSA OAEP cipher contexts. This function creates an object that can be used to build RSA OAEP cipher contexts for asymmetric cryptography.IRsaOaepContextBuilder*makeRsaOaepCipherContextBuilder(IAsymmetricAlgorithm*alg,IDigestAlgorithm*sha)
Parameters
alg
IAsymmetricAlgorithm* — Required
The asymmetric algorithm to be used.
sha
IDigestAlgorithm* — Required
The digest algorithm for SHA.
Returns
IRsaOaepContextBuilder*
The RSA OAEP cipher context builder object.
makeHmacContextBuilder()
Make an object for building HMAC contexts. This function creates an object that can be used to build HMAC contexts.IHmacContextBuilder*makeHmacContextBuilder()
Returns
IHmacContextBuilder*
The HMAC context builder object.
getRandom()
Get random data.u8[]getRandom(i32length)
Parameters
length
i32 — Required
The length of the random data to generate.
Returns
u8[]
An array of random bytes.
makeDigestContextBuilder()
Make an object for building Digest contexts.IDigestContextBuilder*makeDigestContextBuilder()
Returns
IDigestContextBuilder*
A builder for Digest contexts.

