Class PowerAuthClientVault
java.lang.Object
io.getlime.security.powerauth.crypto.client.vault.PowerAuthClientVault
Class implementing client-side processes related to PowerAuth secure vault.
- Author:
- Petr Dvorak
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecryptDevicePrivateKey(byte[] cDevicePrivateKey, SecretKey vaultEncryptionKey) Decrypts original device private key KEY_DEVICE_PRIVATE using the vault encryption key KEY_ENCRYPTION_VAULT.decryptVaultEncryptionKey(byte[] cVaultEncryptionKey, SecretKey transportKey) Decrypts the vault encryption key KEY_ENCRYPTION_VAULT using KEY_TRANSPORT.byte[]encryptDevicePrivateKey(PrivateKey devicePrivateKey, SecretKey vaultEncryptionKey) Encrypts original device private key KEY_DEVICE_PRIVATE using the vault encryption key KEY_ENCRYPTION_VAULT.
-
Constructor Details
-
PowerAuthClientVault
public PowerAuthClientVault()
-
-
Method Details
-
decryptVaultEncryptionKey
public SecretKey decryptVaultEncryptionKey(byte[] cVaultEncryptionKey, SecretKey transportKey) throws InvalidKeyException, GenericCryptoException, CryptoProviderException Decrypts the vault encryption key KEY_ENCRYPTION_VAULT using KEY_TRANSPORT.PowerAuth protocol versions:
- 3.0
- 3.1
- 3.2
- Parameters:
cVaultEncryptionKey- Encrypted vault encryption key KEY_ENCRYPTION_VAULT.transportKey- Transport key used for for decrypting vault encryption key.- Returns:
- Original KEY_ENCRYPTION_VAULT
- Throws:
InvalidKeyException- In case invalid key is provided.GenericCryptoException- In case decryption fails.CryptoProviderException- In case cryptography provider is incorrectly initialized.
-
encryptDevicePrivateKey
public byte[] encryptDevicePrivateKey(PrivateKey devicePrivateKey, SecretKey vaultEncryptionKey) throws InvalidKeyException, GenericCryptoException, CryptoProviderException Encrypts original device private key KEY_DEVICE_PRIVATE using the vault encryption key KEY_ENCRYPTION_VAULT.- Parameters:
devicePrivateKey- Device private key KEY_DEVICE_PRIVATE.vaultEncryptionKey- Vault encryption key KEY_ENCRYPTION_VAULT.- Returns:
- Encrypted private key.
- Throws:
InvalidKeyException- In case invalid key is provided.GenericCryptoException- In case encryption fails.CryptoProviderException- In case cryptography provider is incorrectly initialized.
-
decryptDevicePrivateKey
public PrivateKey decryptDevicePrivateKey(byte[] cDevicePrivateKey, SecretKey vaultEncryptionKey) throws InvalidKeyException, InvalidKeySpecException, GenericCryptoException, CryptoProviderException Decrypts original device private key KEY_DEVICE_PRIVATE using the vault encryption key KEY_ENCRYPTION_VAULT.- Parameters:
cDevicePrivateKey- Encrypted device private key KEY_DEVICE_PRIVATE.vaultEncryptionKey- Vault encryption key KEY_ENCRYPTION_VAULT.- Returns:
- Original private key.
- Throws:
InvalidKeyException- In case invalid key is provided.InvalidKeySpecException- In case key spec is invalid.GenericCryptoException- In case decryption fails.CryptoProviderException- In case cryptography provider is incorrectly initialized.
-