This commit is contained in:
Lucio Lelii 2016-02-10 14:19:19 +00:00
parent c612694ed6
commit 8e26e518da
1 changed files with 2 additions and 4 deletions

View File

@ -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);
}
}