@Override public void reencryptEncryptedKeys(final List<EncryptedKeyVersion> ekvs) throws IOException, GeneralSecurityException { try { doOp(new ProviderCallable<Void>() { @Override public Void call(KMSClientProvider provider) throws IOException, GeneralSecurityException { provider.reencryptEncryptedKeys(ekvs); return null; } }, nextIdx(), true); } catch (WrapperException we) { if (we.getCause() instanceof GeneralSecurityException) { throw (GeneralSecurityException) we.getCause(); } throw new IOException(we.getCause()); } }
@Override public KeyVersion decryptEncryptedKey(final EncryptedKeyVersion encryptedKeyVersion) throws IOException, GeneralSecurityException { try { return doOp(new ProviderCallable<KeyVersion>() { @Override public KeyVersion call(KMSClientProvider provider) throws IOException, GeneralSecurityException { return provider.decryptEncryptedKey(encryptedKeyVersion); } }, nextIdx(), true); } catch (WrapperException we) { if (we.getCause() instanceof GeneralSecurityException) { throw (GeneralSecurityException) we.getCause(); } throw new IOException(we.getCause()); } }
@Override public KeyVersion createKey(final String name, final Options options) throws NoSuchAlgorithmException, IOException { try { return doOp(new ProviderCallable<KeyVersion>() { @Override public KeyVersion call(KMSClientProvider provider) throws IOException, NoSuchAlgorithmException { return provider.createKey(name, options); } }, nextIdx(), false); } catch (WrapperException e) { if (e.getCause() instanceof GeneralSecurityException) { throw (NoSuchAlgorithmException) e.getCause(); } throw new IOException(e.getCause()); } }
@Override public KeyVersion createKey(final String name, final Options options) throws NoSuchAlgorithmException, IOException { try { return doOp(new ProviderCallable<KeyVersion>() { @Override public KeyVersion call(KMSClientProvider provider) throws IOException, NoSuchAlgorithmException { return provider.createKey(name, options); } }, nextIdx()); } catch (WrapperException e) { if (e.getCause() instanceof GeneralSecurityException) { throw (NoSuchAlgorithmException) e.getCause(); } throw new IOException(e.getCause()); } } @Override
@Override public EncryptedKeyVersion generateEncryptedKey(final String encryptionKeyName) throws IOException, GeneralSecurityException { try { return doOp(new ProviderCallable<EncryptedKeyVersion>() { @Override public EncryptedKeyVersion call(KMSClientProvider provider) throws IOException, GeneralSecurityException { return provider.generateEncryptedKey(encryptionKeyName); } }, nextIdx()); } catch (WrapperException we) { throw (GeneralSecurityException) we.getCause(); } }
@Override public KeyVersion decryptEncryptedKey(final EncryptedKeyVersion encryptedKeyVersion) throws IOException, GeneralSecurityException { try { return doOp(new ProviderCallable<KeyVersion>() { @Override public KeyVersion call(KMSClientProvider provider) throws IOException, GeneralSecurityException { return provider.decryptEncryptedKey(encryptedKeyVersion); } }, nextIdx()); } catch (WrapperException we) { throw (GeneralSecurityException)we.getCause(); } }
@Override public KeyVersion rollNewVersion(final String name) throws NoSuchAlgorithmException, IOException { try { return doOp(new ProviderCallable<KeyVersion>() { @Override public KeyVersion call(KMSClientProvider provider) throws IOException, NoSuchAlgorithmException { return provider.rollNewVersion(name); } }, nextIdx()); } catch (WrapperException e) { if (e.getCause() instanceof GeneralSecurityException) { throw (NoSuchAlgorithmException) e.getCause(); } throw new IOException(e.getCause()); } }
@Override public KeyVersion createKey(final String name, final Options options) throws NoSuchAlgorithmException, IOException { try { return doOp(new ProviderCallable<KeyVersion>() { @Override public KeyVersion call(KMSClientProvider provider) throws IOException, NoSuchAlgorithmException { return provider.createKey(name, options); } }, nextIdx()); } catch (WrapperException e) { throw (NoSuchAlgorithmException)e.getCause(); } } @Override
@Override public KeyVersion decryptEncryptedKey(final EncryptedKeyVersion encryptedKeyVersion) throws IOException, GeneralSecurityException { try { return doOp(new ProviderCallable<KeyVersion>() { @Override public KeyVersion call(KMSClientProvider provider) throws IOException, GeneralSecurityException { return provider.decryptEncryptedKey(encryptedKeyVersion); } }, nextIdx()); } catch (WrapperException we) { throw (GeneralSecurityException)we.getCause(); } }
@Override public KeyVersion createKey(final String name, final Options options) throws NoSuchAlgorithmException, IOException { try { return doOp(new ProviderCallable<KeyVersion>() { @Override public KeyVersion call(KMSClientProvider provider) throws IOException, NoSuchAlgorithmException { return provider.createKey(name, options); } }, nextIdx()); } catch (WrapperException e) { throw (NoSuchAlgorithmException)e.getCause(); } } @Override
@Override public EncryptedKeyVersion generateEncryptedKey(final String encryptionKeyName) throws IOException, GeneralSecurityException { try { return doOp(new ProviderCallable<EncryptedKeyVersion>() { @Override public EncryptedKeyVersion call(KMSClientProvider provider) throws IOException, GeneralSecurityException { return provider.generateEncryptedKey(encryptionKeyName); } }, nextIdx()); } catch (WrapperException we) { throw (GeneralSecurityException) we.getCause(); } }
@Override public KeyVersion rollNewVersion(final String name) throws NoSuchAlgorithmException, IOException { try { return doOp(new ProviderCallable<KeyVersion>() { @Override public KeyVersion call(KMSClientProvider provider) throws IOException, NoSuchAlgorithmException { return provider.rollNewVersion(name); } }, nextIdx()); } catch (WrapperException e) { throw (NoSuchAlgorithmException)e.getCause(); } }
@Override public KeyVersion rollNewVersion(final String name) throws NoSuchAlgorithmException, IOException { try { return doOp(new ProviderCallable<KeyVersion>() { @Override public KeyVersion call(KMSClientProvider provider) throws IOException, NoSuchAlgorithmException { return provider.rollNewVersion(name); } }, nextIdx()); } catch (WrapperException e) { throw (NoSuchAlgorithmException)e.getCause(); } }
@Override public KeyVersion createKey(final String name, final Options options) throws NoSuchAlgorithmException, IOException { try { return doOp(new ProviderCallable<KeyVersion>() { @Override public KeyVersion call(KMSClientProvider provider) throws IOException, NoSuchAlgorithmException { return provider.createKey(name, options); } }, nextIdx()); } catch (WrapperException e) { throw (NoSuchAlgorithmException)e.getCause(); } } @Override
@Override public KeyVersion rollNewVersion(final String name) throws NoSuchAlgorithmException, IOException { try { return doOp(new ProviderCallable<KeyVersion>() { @Override public KeyVersion call(KMSClientProvider provider) throws IOException, NoSuchAlgorithmException { return provider.rollNewVersion(name); } }, nextIdx()); } catch (WrapperException e) { throw (NoSuchAlgorithmException)e.getCause(); } }
@Override public KeyVersion decryptEncryptedKey(final EncryptedKeyVersion encryptedKeyVersion) throws IOException, GeneralSecurityException { try { return doOp(new ProviderCallable<KeyVersion>() { @Override public KeyVersion call(KMSClientProvider provider) throws IOException, GeneralSecurityException { return provider.decryptEncryptedKey(encryptedKeyVersion); } }, nextIdx()); } catch (WrapperException we) { throw (GeneralSecurityException)we.getCause(); } }
@Override public EncryptedKeyVersion generateEncryptedKey(final String encryptionKeyName) throws IOException, GeneralSecurityException { try { return doOp(new ProviderCallable<EncryptedKeyVersion>() { @Override public EncryptedKeyVersion call(KMSClientProvider provider) throws IOException, GeneralSecurityException { return provider.generateEncryptedKey(encryptionKeyName); } }, nextIdx()); } catch (WrapperException we) { throw (GeneralSecurityException) we.getCause(); } }
@Override public KeyVersion rollNewVersion(final String name) throws NoSuchAlgorithmException, IOException { try { final KeyVersion newVersion = doOp(new ProviderCallable<KeyVersion>() { @Override public KeyVersion call(KMSClientProvider provider) throws IOException, NoSuchAlgorithmException { return provider.rollNewVersion(name); } }, nextIdx(), false); invalidateCache(name); return newVersion; } catch (WrapperException e) { if (e.getCause() instanceof GeneralSecurityException) { throw (NoSuchAlgorithmException) e.getCause(); } throw new IOException(e.getCause()); } }
@Override public EncryptedKeyVersion reencryptEncryptedKey( final EncryptedKeyVersion ekv) throws IOException, GeneralSecurityException { try { return doOp(new ProviderCallable<EncryptedKeyVersion>() { @Override public EncryptedKeyVersion call(KMSClientProvider provider) throws IOException, GeneralSecurityException { return provider.reencryptEncryptedKey(ekv); } }, nextIdx(), true); } catch (WrapperException we) { if (we.getCause() instanceof GeneralSecurityException) { throw (GeneralSecurityException) we.getCause(); } throw new IOException(we.getCause()); } }
@Override public EncryptedKeyVersion generateEncryptedKey(final String encryptionKeyName) throws IOException, GeneralSecurityException { try { return doOp(new ProviderCallable<EncryptedKeyVersion>() { @Override public EncryptedKeyVersion call(KMSClientProvider provider) throws IOException, GeneralSecurityException { return provider.generateEncryptedKey(encryptionKeyName); } }, nextIdx(), true); } catch (WrapperException we) { if (we.getCause() instanceof GeneralSecurityException) { throw (GeneralSecurityException) we.getCause(); } throw new IOException(we.getCause()); } }