/** * Roll a new version of the given key generating the material for it. * <p> * Due to the caching on the ValueQueue, even after a rollNewVersion call, * {@link #generateEncryptedKey(String)} may still return an old key - even * when we drain the queue here, the async thread may later fill in old keys. * This is acceptable since old version keys are still able to decrypt, and * client shall make no assumptions that it will get a new versioned key * after rollNewVersion. */ @Override public KeyVersion rollNewVersion(String name) throws NoSuchAlgorithmException, IOException { KeyVersion keyVersion = super.rollNewVersion(name); getExtension().drain(name); return keyVersion; }
@Override public void invalidateCache(String name) throws IOException { super.invalidateCache(name); getExtension().drain(name); } }
@Override public KeyVersion rollNewVersion(String name, byte[] material) throws IOException { KeyVersion keyVersion = super.rollNewVersion(name, material); getExtension().drain(name); return keyVersion; }
/** * Calls {@link CryptoExtension#drain(String)} for the given key name on the * underlying {@link CryptoExtension}. * * @param keyName */ public void drain(String keyName) { getExtension().drain(keyName); }