Class EncryptedStorageUtil
java.lang.Object
io.getlime.security.powerauth.lib.cmd.util.EncryptedStorageUtil
public class EncryptedStorageUtil
extends java.lang.Object
Utility class implementing processes related to data storage on client side.
- Author:
- Petr Dvorak
-
Constructor Summary
Constructors Constructor Description EncryptedStorageUtil() -
Method Summary
Modifier and Type Method Description static javax.crypto.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, javax.crypto.SecretKey signatureKnowledgeSecretKey, byte[] salt, io.getlime.security.powerauth.crypto.lib.generator.KeyGenerator keyGenerator)Encrypt the KEY_SIGNATURE_KNOWLEDGE key using a provided password.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
EncryptedStorageUtil
public EncryptedStorageUtil()
-
-
Method Details
-
storeSignatureKnowledgeKey
public static byte[] storeSignatureKnowledgeKey(char[] password, javax.crypto.SecretKey signatureKnowledgeSecretKey, byte[] salt, io.getlime.security.powerauth.crypto.lib.generator.KeyGenerator keyGenerator) throws java.security.InvalidKeyException, io.getlime.security.powerauth.crypto.lib.model.exception.GenericCryptoException, io.getlime.security.powerauth.crypto.lib.model.exception.CryptoProviderExceptionEncrypt 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:
java.security.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 javax.crypto.SecretKey getSignatureKnowledgeKey(char[] password, byte[] cSignatureKnowledgeSecretKeyBytes, byte[] salt, io.getlime.security.powerauth.crypto.lib.generator.KeyGenerator keyGenerator) throws java.security.InvalidKeyException, io.getlime.security.powerauth.crypto.lib.model.exception.GenericCryptoException, io.getlime.security.powerauth.crypto.lib.model.exception.CryptoProviderExceptionDecrypt 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:
java.security.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.
-