git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/Common/common-encryption@124046 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c612694ed6
commit
8e26e518da
|
@ -39,6 +39,7 @@ final class SymmetricKey {
|
|||
* @return the key
|
||||
* @throws InvalidKeyException if the key is not available or is invalid
|
||||
*/
|
||||
@Deprecated
|
||||
protected static Key getKey() throws InvalidKeyException {
|
||||
if (key == null) load();
|
||||
return key;
|
||||
|
@ -62,15 +63,12 @@ final class SymmetricKey {
|
|||
InputStream is =SymmetricKey.class.getResourceAsStream("/"+keyFileName);
|
||||
rawKey = getBytesFromStream(is);
|
||||
} catch (Exception e) {
|
||||
System.out.println("Unable to load the Key "+keyFileName+" from the classpath");
|
||||
e.printStackTrace();
|
||||
throw new InvalidKeyException("Unable to load the Key "+keyFileName+" from the classpath");
|
||||
}
|
||||
try {
|
||||
key = new SecretKeySpec(rawKey, 0, rawKey.length, keyAlgorithm);
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new InvalidKeyException();
|
||||
throw new InvalidKeyException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue