Class EncryptedStorageUtil
java.lang.Object
io.getlime.security.powerauth.lib.cmd.util.EncryptedStorageUtil
Utility class implementing processes related to data storage on client side.
- Author:
- Petr Dvorak
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SecretKeygetSignatureKnowledgeKey(char[] password, byte[] cSignatureKnowledgeSecretKeyBytes, byte[] salt, io.getlime.security.powerauth.crypto.lib.generator.KeyGenerator keyGenerator) Decrypt the KEY_SIGNATURE_KNOWLEDGE key using a provided password.static byte[]storeSignatureKnowledgeKey(char[] password, SecretKey signatureKnowledgeSecretKey, byte[] salt, io.getlime.security.powerauth.crypto.lib.generator.KeyGenerator keyGenerator) Encrypt the KEY_SIGNATURE_KNOWLEDGE key using a provided password.
-
Constructor Details
-
EncryptedStorageUtil
public EncryptedStorageUtil()
-
-
Method Details
-
storeSignatureKnowledgeKey
public static byte[] storeSignatureKnowledgeKey(char[] password, SecretKey signatureKnowledgeSecretKey, byte[] salt, io.getlime.security.powerauth.crypto.lib.generator.KeyGenerator keyGenerator) throws InvalidKeyException, io.getlime.security.powerauth.crypto.lib.model.exception.GenericCryptoException, io.getlime.security.powerauth.crypto.lib.model.exception.CryptoProviderException Encrypt the KEY_SIGNATURE_KNOWLEDGE key using a provided password.- Parameters:
password- Password to be used for encryption.signatureKnowledgeSecretKey- Original KEY_SIGNATURE_KNOWLEDGE key.salt- Random salt.keyGenerator- Key generator instance.- Returns:
- Encrypted KEY_SIGNATURE_KNOWLEDGE using password and random salt.
- Throws:
InvalidKeyException- In case invalid key is provided.io.getlime.security.powerauth.crypto.lib.model.exception.CryptoProviderException- In case cryptography provider is initialized incorrectly.io.getlime.security.powerauth.crypto.lib.model.exception.GenericCryptoException- In case any other cryptography error occurs.
-
getSignatureKnowledgeKey
public static SecretKey getSignatureKnowledgeKey(char[] password, byte[] cSignatureKnowledgeSecretKeyBytes, byte[] salt, io.getlime.security.powerauth.crypto.lib.generator.KeyGenerator keyGenerator) throws InvalidKeyException, io.getlime.security.powerauth.crypto.lib.model.exception.GenericCryptoException, io.getlime.security.powerauth.crypto.lib.model.exception.CryptoProviderException Decrypt the KEY_SIGNATURE_KNOWLEDGE key using a provided password.- Parameters:
password- Password to be used for decryption.cSignatureKnowledgeSecretKeyBytes- Encrypted KEY_SIGNATURE_KNOWLEDGE key.salt- Salt that was used for encryption.keyGenerator- Key generator instance.- Returns:
- Original KEY_SIGNATURE_KNOWLEDGE key.
- Throws:
InvalidKeyException- In case invalid key is provided.io.getlime.security.powerauth.crypto.lib.model.exception.CryptoProviderException- In case cryptography provider is initialized incorrectly.io.getlime.security.powerauth.crypto.lib.model.exception.GenericCryptoException- In case any other cryptography error occurs.
-