Functions -
crypto
crc32b | Returns Hex encoded CRC32B value for the provided element. |
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. |
externDecodePublicKey | |
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.
Parameters
- input byte[]
-
Value for checksum generation
-
Return Type
(string) The generated checksum
decodePrivateKey
(KeyStore | TrustStore keyStore, string keyAlias, string keyPassword)
returns PrivateKey | ErrorRead a private key from the provided PKCS#12 archive file.
Parameters
- keyStore KeyStore | TrustStore
-
Key store or Trust store configurations
- keyAlias string
-
Key alias
- keyPassword string
-
Key password
-
Return Type
(PrivateKey | Error) Reference to the private key or
Error
if private key was unreadable
Read a public key from the provided PKCS#12 archive file.
Parameters
- keyStore KeyStore | TrustStore
-
Key store or Trust store configurations
- keyAlias string
-
Key alias
Returns 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 (default PKCS5)
-
The padding
-
Return Type
(byte[] | Error) Decrypted data or
Error
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 (default PKCS5)
-
The padding
-
Return Type
(byte[] | Error) Decrypted data or
Error
if key is invalid
decryptAesGcm
(byte[] input, byte[] key, byte[] iv, AesPadding padding, int tagSize)
returns byte[] | ErrorReturns 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 (default PKCS5)
-
The padding
- tagSize int (default 128)
-
Tag size
-
Return Type
(byte[] | Error) Decrypted data or
Error
if key is invalid
Returns 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 (default PKCS1)
-
The padding
-
Return Type
(byte[] | Error) Decrypted data or
Error
if key is invalid
Returns 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 (default PKCS5)
-
The padding
-
Return Type
(byte[] | Error) Encrypted data or
Error
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 (default PKCS5)
-
The padding
-
Return Type
(byte[] | Error) Encrypted data or
Error
if key is invalid
encryptAesGcm
(byte[] input, byte[] key, byte[] iv, AesPadding padding, int tagSize)
returns byte[] | ErrorReturns 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 (default PKCS5)
-
The padding
- tagSize int (default 128)
-
Tag size
-
Return Type
(byte[] | Error) Encrypted data or
Error
if key is invalid
Returns 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 (default PKCS1)
-
The padding
-
Return Type
(byte[] | Error) Encrypted data or
Error
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.
Parameters
- input byte[]
-
Value to be hashed
- key byte[]
-
Key used for HMAC generation
-
Return Type
(byte[]) HMAC output
Returns the HMAC using SHA-1 hash function of the given data.
Parameters
- input byte[]
-
Value to be hashed
- key byte[]
-
Key used for HMAC generation
-
Return Type
(byte[]) HMAC output
Returns the HMAC using SHA-256 hash function of the given data.
Parameters
- input byte[]
-
Value to be hashed
- key byte[]
-
Key used for HMAC generation
-
Return Type
(byte[]) HMAC output
Returns the HMAC using SHA-384 hash function of the given data.
Parameters
- input byte[]
-
Value to be hashed
- key byte[]
-
Key used for HMAC generation
-
Return Type
(byte[]) HMAC output
Returns the HMAC using SHA-512 hash function of the given data.
Parameters
- input byte[]
-
Value to be hashed
- key byte[]
-
Key used for HMAC generation
-
Return Type
(byte[]) HMAC output
Returns RSA-MD5 based signature value for the given data.
-
Return Type
(byte[] | Error) The generated signature or
Error
if private key is invalid
Returns RSA-SHA1 based signature value for the given data.
-
Return Type
(byte[] | Error) The generated signature or
Error
if private key is invalid
Returns RSA-SHA256 based signature value for the given data.
-
Return Type
(byte[] | Error) The generated signature or
Error
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[] | Error) The generated signature or
Error
if private key is invalid
Returns RSA-SHA512 based signature value for the given data.
-
Return Type
(byte[] | Error) The generated signature or
Error
if private key is invalid
Verify 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 | Error) Validity of the signature or
Error
if public key is invalid
Verify 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 | Error) Validity of the signature or
Error
if public key is invalid
verifyRsaSha256Signature
(byte[] data, byte[] signature, PublicKey publicKey)
returns boolean | ErrorVerify 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 | Error) Validity of the signature or
Error
if public key is invalid
verifyRsaSha384Signature
(byte[] data, byte[] signature, PublicKey publicKey)
returns boolean | ErrorVerify 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 | Error) Validity of the signature or
Error
if public key is invalid
verifyRsaSha512Signature
(byte[] data, byte[] signature, PublicKey publicKey)
returns boolean | ErrorVerify 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 | Error) Validity of the signature or
Error
if public key is invalid