Module : crypto

Version : 1.0.0

Module Overview

This module provides the necessary utilities that are required to hash content using different hashing mechanisms and algorithms.

For information on the operations, which you can perform with this module, see the below Functions. For an example on the usage of the operations, see the Cryptographic Operations Example.

Records

Certificate

X509 public key certificate information.

KeyStore

Key store related configurations.

PrivateKey

Private key used in cryptographic operations.

PublicKey

Public key used in cryptographic operations.

TrustStore

Trust store related configurations.

Functions

buildRsaPublicKey
I

Returns the crypto:PublicKey created with the modulus and exponent retrieved from the JWK's endpoint.

crc32b
I

Returns the Hex-encoded CRC32B value for the provided element.

decodePrivateKey
I

Reads a private key from the provided PKCS#12 archive file.

decodePublicKey
I

Reads a public key from the provided PKCS#12 archive file.

decryptAesCbc
I

Returns the AES-CBC-decrypted value for the given AES-CBC-encrypted data.

decryptAesEcb
I

Returns the AES-ECB-decrypted value for the given AES-ECB-encrypted data.

decryptAesGcm
I

Returns the AES-GCM-decrypted value for the given AES-GCM-encrypted data.

decryptRsaEcb
I

Returns the RSA-decrypted value for the given RSA-encrypted data.

encryptAesCbc
I

Returns the AES-CBC-encrypted value for the given data.

encryptAesEcb
I

Returns the AES-ECB-encrypted value for the given data.

encryptAesGcm
I

Returns the AES-GCM-encrypted value for the given data.

encryptRsaEcb
I

Returns the RSA-encrypted value for the given data.

hashMd5
I

Returns the MD5 hash of the given data.

hashSha1
I

Returns the SHA-1 hash of the given data.

hashSha256
I

Returns the SHA-256 hash of the given data.

hashSha384
I

Returns the SHA-384 hash of the given data.

hashSha512
I

Returns the SHA-512 hash of the given data.

hmacMd5
I

Returns the HMAC using the MD-5 hash function of the given data.

hmacSha1
I

Returns the HMAC using the SHA-1 hash function of the given data.

hmacSha256
I

Returns the HMAC using the SHA-256 hash function of the given data.

hmacSha384
I

Returns the HMAC using the SHA-384 hash function of the given data.

hmacSha512
I

Returns the HMAC using the SHA-512 hash function of the given data.

signRsaMd5
I

Returns the RSA-MD5-based signature value for the given data.

signRsaSha1
I

Returns the RSA-SHA1-based signature value for the given data.

signRsaSha256
I

Returns the RSA-SHA256-based signature value for the given data.

signRsaSha384
I

Returns the RSA-SHA384-based signature value for the given data.

signRsaSha512
I

Returns the RSA-SHA512-based signature value for the given data.

verifyRsaMd5Signature
I

Verifies the RSA-MD5-based signature.

verifyRsaSha1Signature
I

Verifies the RSA-SHA1-based signature.

verifyRsaSha256Signature
I

Verifies the RSA-SHA256-based signature.

verifyRsaSha384Signature
I

Verifies the RSA-SHA384-based signature.

verifyRsaSha512Signature
I

Verifies the RSA-SHA512-based signature.

Constants

RSA

The RSA algorithm.

NONE

No padding.

PKCS1

The PKCS1 padding mode.

PKCS5

The PKCS5 padding mode.

OAEPwithMD5andMGF1

The OAEPwithMD5andMGF1 padding mode.

OAEPWithSHA1AndMGF1

The OAEPWithSHA1AndMGF1 padding mode.

OAEPWithSHA256AndMGF1

The OAEPWithSHA256AndMGF1 padding mode.

OAEPwithSHA384andMGF1

The OAEPwithSHA384andMGF1 padding mode.

OAEPwithSHA512andMGF1

The OAEPwithSHA512andMGF1 padding mode.

Types

AesPadding

Padding algorithms supported by AES encryption and decryption.

Error

The union of all the Crypto related errors

KeyAlgorithm

The key algorithms supported by the Crypto module.

RsaPadding

Padding algorithms supported with RSA encryption and decryption.

Errors

CryptoError

Represents the Crypto error.