mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-18 02:12:06 +01:00
Clean up CachingBcPublicKeyDataDecryptorFactory
This commit is contained in:
parent
b495e602e5
commit
be7349f0b5
1 changed files with 7 additions and 3 deletions
|
@ -59,16 +59,20 @@ public class CachingBcPublicKeyDataDecryptorFactory
|
|||
}
|
||||
|
||||
private byte[] lookupSessionKeyData(byte[][] secKeyData) {
|
||||
byte[] sk = secKeyData[0];
|
||||
String key = Base64.toBase64String(sk);
|
||||
String key = toKey(secKeyData);
|
||||
byte[] sessionKey = cachedSessionKeys.get(key);
|
||||
return copy(sessionKey);
|
||||
}
|
||||
|
||||
private void cacheSessionKeyData(byte[][] secKeyData, byte[] sessionKey) {
|
||||
String key = toKey(secKeyData);
|
||||
cachedSessionKeys.put(key, copy(sessionKey));
|
||||
}
|
||||
|
||||
private static String toKey(byte[][] secKeyData) {
|
||||
byte[] sk = secKeyData[0];
|
||||
String key = Base64.toBase64String(sk);
|
||||
cachedSessionKeys.put(key, copy(sessionKey));
|
||||
return key;
|
||||
}
|
||||
|
||||
private static byte[] copy(byte[] bytes) {
|
||||
|
|
Loading…
Reference in a new issue