Class KeyDerivationUtils
java.lang.Object
io.getlime.security.powerauth.crypto.lib.util.KeyDerivationUtils
The
KeyDerivationUtils class provides additional key derivation functionality defined for PowerAuth protocol.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]deriveIvForStatusBlobEncryption(byte[] challenge, byte[] nonce, SecretKey transportKey) Derive Initialization Vector for AES-CBC cipher used for an activation status blob encryption and decryption.
-
Constructor Details
-
KeyDerivationUtils
public KeyDerivationUtils()
-
-
Method Details
-
deriveIvForStatusBlobEncryption
public byte[] deriveIvForStatusBlobEncryption(byte[] challenge, byte[] nonce, SecretKey transportKey) throws GenericCryptoException, CryptoProviderException, InvalidKeyException Derive Initialization Vector for AES-CBC cipher used for an activation status blob encryption and decryption. The function also supports older protocol versions (V2, V3), where IV was hard-set to array of zero bytes. In this case, bothchallengeandnonceparameters must benull.Note that non-zero IV was introduced in the protocol version 3.1
- Parameters:
challenge- Cryptographic challenge received from the client, or generated in the client.nonce- Cryptographic nonce received from the server, or generated in the server.transportKey- Transport key.- Returns:
- Initialization vector, or zero filled IV when both,
challengeandnonceparameters arenull. - Throws:
GenericCryptoException- In case that key derivation fails or you provided invalid challenge or nonce.CryptoProviderException- In case cryptography provider is incorrectly initialized.InvalidKeyException- In case that transport key is not valid.
-