Package org.gcube.common.encryption
Class SymmetricKey
java.lang.Object
org.gcube.common.encryption.SymmetricKey
- Author:
- Roberto Cirillo (ISTI - CNR), Lucio Lelii (ISTI - CNR), Luca Frosini (ISTI - CNR)
-
Method Summary
Modifier and TypeMethodDescriptionstatic KeygetKey()Gets the key for encryption/decryptionprotected static StringgetKeyFileName(String context) Gets the key file name for the given contextstatic KeyloadKeyFromFile(File keyFile, String keyAlgorithm) Loads a key from the specified file using the given algorithm
-
Method Details
-
getKey
Gets the key for encryption/decryption- Returns:
- the key
- Throws:
InvalidKeyException- if the key is not available or is invalid
-
loadKeyFromFile
Loads a key from the specified file using the given algorithm- Parameters:
keyFile- the file containing the keykeyAlgorithm- the algorithm of the key- Returns:
- the loaded key
- Throws:
InvalidKeyException- if the key cannot be loaded
-
getKeyFileName
Gets the key file name for the given context- Parameters:
context- the context to generate the key file name for- Returns:
- the key file name
- Throws:
InvalidKeyException- if the context is invalid
-