Functions -
crypto
crc32b | Returns Hex encoded CRC32B value for the provided element. This accepts |
decodePrivateKey | Read a private key from the provided PKCS#12 archive file. |
decodePublicKey | Read a public key from the provided PKCS#12 archive file. |
decryptAesCbc | Returns AES CBC decrypted value for the given AES CBC encrypted data. |
decryptAesEcb | Returns AES ECB decrypted value for the given AES ECB encrypted data. |
decryptAesGcm | Returns AES GCM decrypted value for the given AES GCM encrypted data. |
decryptRsaEcb | Returns RSA decrypted value for the given RSA encrypted data. |
encryptAesCbc | Returns AES CBC encrypted value for the given data. |
encryptAesEcb | Returns AES ECB encrypted value for the given data. |
encryptAesGcm | Returns AES GCM encrypted value for the given data. |
encryptRsaEcb | Returns RSA encrypted value for the given data. |
hashMd5 | Returns the MD5 hash of the given data. |
hashSha1 | Returns the SHA-1 hash of the given data. |
hashSha256 | Returns the SHA-256 hash of the given data. |
hashSha384 | Returns the SHA-384 hash of the given data. |
hashSha512 | Returns the SHA-512 hash of the given data. |
hmacMd5 | Returns the HMAC using MD-5 hash function of the given data. |
hmacSha1 | Returns the HMAC using SHA-1 hash function of the given data. |
hmacSha256 | Returns the HMAC using SHA-256 hash function of the given data. |
hmacSha384 | Returns the HMAC using SHA-384 hash function of the given data. |
hmacSha512 | Returns the HMAC using SHA-512 hash function of the given data. |
signRsaMd5 | Returns RSA-MD5 based signature value for the given data. |
signRsaSha1 | Returns RSA-SHA1 based signature value for the given data. |
signRsaSha256 | Returns RSA-SHA256 based signature value for the given data. |
signRsaSha384 | Returns RSA-SHA384 based signature value for the given data. |
signRsaSha512 | Returns RSA-SHA512 based signature value for the given data. |
verifyRsaMd5Signature | Verify RSA-MD5 based signature. |
verifyRsaSha1Signature | Verify RSA-SHA1 based signature. |
verifyRsaSha256Signature | Verify RSA-SHA256 based signature. |
verifyRsaSha384Signature | Verify RSA-SHA384 based signature. |
verifyRsaSha512Signature | Verify RSA-SHA512 based signature. |
Returns Hex encoded CRC32B value for the provided element. This accepts string
, byte[]
, json
and xml
content.
Parameters
- input any
-
Value for checksum generation
-
Return Type
(string) The generated checksum
decodePrivateKey
(KeyStore? keyStore, string? keyAlias, string? keyPassword)
returns PrivateKey | CryptoErrorRead a private key from the provided PKCS#12 archive file.
Parameters
- keyStore KeyStore? - ()
-
Key store configuration
- keyAlias string? - ()
-
Key alias
- keyPassword string? - ()
-
Key password
-
Return Type
(PrivateKey | CryptoError) Reference to the private key or
CryptoError
if private key was unreadable
Read a public key from the provided PKCS#12 archive file.
-
Return Type
(PublicKey | CryptoError) Reference to the public key or
CryptoError
if private key was unreadable
decryptAesCbc
(byte[] input, byte[] key, byte[] iv, AesPadding padding)
returns byte[] | CryptoErrorReturns AES CBC decrypted value for the given AES CBC encrypted data.
Parameters
- input byte[]
-
The content to be decrypted
- key byte[]
-
Encryption key
- iv byte[]
-
Initialization vector
- padding AesPadding - PKCS5
-
The padding
-
Return Type
(byte[] | CryptoError) Decrypted data or
CryptoError
if key is invalid
Returns AES ECB decrypted value for the given AES ECB encrypted data.
Parameters
- input byte[]
-
The content to be decrypted
- key byte[]
-
Encryption key
- padding AesPadding - PKCS5
-
The padding
-
Return Type
(byte[] | CryptoError) Decrypted data or
CryptoError
if key is invalid
decryptAesGcm
(byte[] input, byte[] key, byte[] iv, AesPadding padding, int tagSize)
returns byte[] | CryptoErrorReturns AES GCM decrypted value for the given AES GCM encrypted data.
Parameters
- input byte[]
-
The content to be decrypted
- key byte[]
-
Encryption key
- iv byte[]
-
Initialization vector
- padding AesPadding - PKCS5
-
The padding
- tagSize int - 128
-
Tag size
-
Return Type
(byte[] | CryptoError) Decrypted data or
CryptoError
if key is invalid
decryptRsaEcb
(byte[] input, PrivateKey | PublicKey key, RsaPadding padding)
returns byte[] | CryptoErrorReturns RSA decrypted value for the given RSA encrypted data.
Parameters
- input byte[]
-
The content to be decrypted
- key PrivateKey | PublicKey
-
Private or public key used for encryption
- padding RsaPadding - PKCS1
-
The padding
-
Return Type
(byte[] | CryptoError) Decrypted data or
CryptoError
if key is invalid
encryptAesCbc
(byte[] input, byte[] key, byte[] iv, AesPadding padding)
returns byte[] | CryptoErrorReturns AES CBC encrypted value for the given data.
Parameters
- input byte[]
-
The content to be encrypted
- key byte[]
-
Encryption key
- iv byte[]
-
Initialization vector
- padding AesPadding - PKCS5
-
The padding
-
Return Type
(byte[] | CryptoError) Encrypted data or
CryptoError
if key is invalid
Returns AES ECB encrypted value for the given data.
Parameters
- input byte[]
-
The content to be encrypted
- key byte[]
-
Encryption key
- padding AesPadding - PKCS5
-
The padding
-
Return Type
(byte[] | CryptoError) Encrypted data or
CryptoError
if key is invalid
encryptAesGcm
(byte[] input, byte[] key, byte[] iv, AesPadding padding, int tagSize)
returns byte[] | CryptoErrorReturns AES GCM encrypted value for the given data.
Parameters
- input byte[]
-
The content to be encrypted
- key byte[]
-
Encryption key
- iv byte[]
-
Initialization vector
- padding AesPadding - PKCS5
-
The padding
- tagSize int - 128
-
Tag size
-
Return Type
(byte[] | CryptoError) Encrypted data or
CryptoError
if key is invalid
encryptRsaEcb
(byte[] input, PrivateKey | PublicKey key, RsaPadding padding)
returns byte[] | CryptoErrorReturns RSA encrypted value for the given data.
Parameters
- input byte[]
-
The content to be encrypted
- key PrivateKey | PublicKey
-
Private or public key used for encryption
- padding RsaPadding - PKCS1
-
The padding
-
Return Type
(byte[] | CryptoError) Encrypted data or
CryptoError
if key is invalid
Returns the MD5 hash of the given data.
Parameters
- input byte[]
-
Value to be hashed
-
Return Type
(byte[]) Hashed output
Returns the SHA-1 hash of the given data.
Parameters
- input byte[]
-
Value to be hashed
-
Return Type
(byte[]) Hashed output
Returns the SHA-256 hash of the given data.
Parameters
- input byte[]
-
Value to be hashed
-
Return Type
(byte[]) Hashed output
Returns the SHA-384 hash of the given data.
Parameters
- input byte[]
-
Value to be hashed
-
Return Type
(byte[]) Hashed output
Returns the SHA-512 hash of the given data.
Parameters
- input byte[]
-
Value to be hashed
-
Return Type
(byte[]) Hashed output
Returns the HMAC using MD-5 hash function of the given data.
-
Return Type
(byte[]) HMAC output
Returns the HMAC using SHA-1 hash function of the given data.
-
Return Type
(byte[]) HMAC output
Returns the HMAC using SHA-256 hash function of the given data.
-
Return Type
(byte[]) HMAC output
Returns the HMAC using SHA-384 hash function of the given data.
-
Return Type
(byte[]) HMAC output
Returns the HMAC using SHA-512 hash function of the given data.
-
Return Type
(byte[]) HMAC output
Returns RSA-MD5 based signature value for the given data.
-
Return Type
(byte[] | CryptoError) The generated signature or
CryptoError
if private key is invalid
Returns RSA-SHA1 based signature value for the given data.
-
Return Type
(byte[] | CryptoError) The generated signature or
CryptoError
if private key is invalid
Returns RSA-SHA256 based signature value for the given data.
-
Return Type
(byte[] | CryptoError) The generated signature or
CryptoError
if private key is invalid
Returns RSA-SHA384 based signature value for the given data.
Parameters
- input byte[]
-
The content to be signed
- privateKey PrivateKey
-
Private key used for signing.
-
Return Type
(byte[] | CryptoError) The generated signature or
CryptoError
if private key is invalid
Returns RSA-SHA512 based signature value for the given data.
-
Return Type
(byte[] | CryptoError) The generated signature or
CryptoError
if private key is invalid
verifyRsaMd5Signature
(byte[] data, byte[] signature, PublicKey publicKey)
returns boolean | CryptoErrorVerify RSA-MD5 based signature.
Parameters
- data byte[]
-
The content to be verified
- signature byte[]
-
Signature value
- publicKey PublicKey
-
Public key used for verification
-
Return Type
(boolean | CryptoError) Validity of the signature or
CryptoError
if public key is invalid
verifyRsaSha1Signature
(byte[] data, byte[] signature, PublicKey publicKey)
returns boolean | CryptoErrorVerify RSA-SHA1 based signature.
Parameters
- data byte[]
-
The content to be verified
- signature byte[]
-
Signature value
- publicKey PublicKey
-
Public key used for verification
-
Return Type
(boolean | CryptoError) Validity of the signature or
CryptoError
if public key is invalid
verifyRsaSha256Signature
(byte[] data, byte[] signature, PublicKey publicKey)
returns boolean | CryptoErrorVerify RSA-SHA256 based signature.
Parameters
- data byte[]
-
The content to be verified
- signature byte[]
-
Signature value
- publicKey PublicKey
-
Public key used for verification
-
Return Type
(boolean | CryptoError) Validity of the signature or
CryptoError
if public key is invalid
verifyRsaSha384Signature
(byte[] data, byte[] signature, PublicKey publicKey)
returns boolean | CryptoErrorVerify RSA-SHA384 based signature.
Parameters
- data byte[]
-
The content to be verified
- signature byte[]
-
Signature value
- publicKey PublicKey
-
Public key used for verification
-
Return Type
(boolean | CryptoError) Validity of the signature or
CryptoError
if public key is invalid
verifyRsaSha512Signature
(byte[] data, byte[] signature, PublicKey publicKey)
returns boolean | CryptoErrorVerify RSA-SHA512 based signature.
Parameters
- data byte[]
-
The content to be verified
- signature byte[]
-
Signature value
- publicKey PublicKey
-
Public key used for verification
-
Return Type
(boolean | CryptoError) Validity of the signature or
CryptoError
if public key is invalid