long decodedExpirationTime = dataStream.readLong();
String decodedPrincipal = dataStream.readUTF();
- HMACHandleEntry macHandleEntry = new HMACHandleEntry(
- createHandleEntry(new AuthNPrincipal(decodedPrincipal)));
+ HMACHandleEntry macHandleEntry = createHMACHandleEntry(new AuthNPrincipal(decodedPrincipal));
macHandleEntry.setExpirationTime(decodedExpirationTime);
byte[] generatedMac = macHandleEntry.getMAC(mac);
Mac mac = Mac.getInstance(macAlgorithm);
mac.init(secret);
- HandleEntry handleEntry = createHandleEntry(principal);
- HMACHandleEntry macHandleEntry = new HMACHandleEntry(handleEntry);
+ HMACHandleEntry macHandleEntry = createHMACHandleEntry(principal);
Cipher cipher = Cipher.getInstance(cipherAlgorithm);
byte[] iv = new byte[cipher.getBlockSize()];
return Arrays.equals(defaultKey, encodedKey);
}
+ protected HMACHandleEntry createHMACHandleEntry(AuthNPrincipal principal) {
+
+ return new HMACHandleEntry(principal, handleTTL);
+ }
+
}
/**
super(principal, TTL);
}
- protected HMACHandleEntry(HandleEntry handleEntry) {
-
- super(handleEntry.principal, handleEntry.expirationTime);
- }
-
private static byte[] getLongBytes(long longValue) {
try {