@Test public void testSetEncryptionKMSCustomKeySignatureVersionV4() throws Exception { final Path container = new Path("test-eu-west-1-cyberduck", EnumSet.of(Path.Type.volume)); final Path test = new Path(container, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file)); new S3TouchFeature(session).touch(test, new TransferStatus()); final S3EncryptionFeature feature = new S3EncryptionFeature(session); feature.setEncryption(test, new Encryption.Algorithm("aws:kms", "arn:aws:kms:eu-west-1:930717317329:key/015fa0af-f95e-483e-8fb6-abffb46fb783")); final Encryption.Algorithm value = feature.getEncryption(test); assertEquals("aws:kms", value.algorithm); assertEquals("arn:aws:kms:eu-west-1:930717317329:key/015fa0af-f95e-483e-8fb6-abffb46fb783", value.key); new S3DefaultDeleteFeature(session).delete(Collections.<Path>singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback()); session.close(); }
@Override public Algorithm getEncryption(final Path file) throws BackgroundException { if(containerService.isContainer(file)) { final String key = String.format("s3.encryption.key.%s", containerService.getContainer(file).getName()); if(StringUtils.isNotBlank(preferences.getProperty(key))) { return Algorithm.fromString(preferences.getProperty(key)); } } return super.getEncryption(file); }
KMSEncryptionFeature extends S3EncryptionFeature { @Override public Algorithm getEncryption(final Path file) throws BackgroundException { if(containerService.isContainer(file)) { final String key = String.format("s3.encryption.key.%s", containerService.getContainer(file).getName()); if(StringUtils.isNotBlank(preferences.getProperty(key))) { return Algorithm.fromString(preferences.getProperty(key)); } } return super.getEncryption(file); } }
KMSEncryptionFeature extends S3EncryptionFeature { @Override public Algorithm getEncryption(final Path file) throws BackgroundException { if(containerService.isContainer(file)) { final String key = String.format("s3.encryption.key.%s", containerService.getContainer(file).getName()); if(StringUtils.isNotBlank(preferences.getProperty(key))) { return Algorithm.fromString(preferences.getProperty(key)); } } return super.getEncryption(file); } KMSEncryptionFeature(final S3Session session, final X509TrustManager trust, final X509KeyManager key); }
KMSEncryptionFeature extends S3EncryptionFeature { @Override public Algorithm getEncryption(final Path file) throws BackgroundException { if(containerService.isContainer(file)) { final String key = String.format("s3.encryption.key.%s", containerService.getContainer(file).getName()); if(StringUtils.isNotBlank(preferences.getProperty(key))) { return Algorithm.fromString(preferences.getProperty(key)); } } return super.getEncryption(file); } KMSEncryptionFeature(final S3Session session, final X509TrustManager trust, final X509KeyManager key); @Override Algorithm getDefault(final Path file); @Override Algorithm getEncryption(final Path file); @Override Set<Algorithm> getKeys(final Path file, final LoginCallback prompt); }
KMSEncryptionFeature extends S3EncryptionFeature { @Override public Algorithm getEncryption(final Path file) throws BackgroundException { if(containerService.isContainer(file)) { final String key = String.format("s3.encryption.key.%s", containerService.getContainer(file).getName()); if(StringUtils.isNotBlank(preferences.getProperty(key))) { return Algorithm.fromString(preferences.getProperty(key)); } } return super.getEncryption(file); } KMSEncryptionFeature(final S3Session session, final X509TrustManager trust, final X509KeyManager key); @Override Algorithm getDefault(final Path file); @Override Algorithm getEncryption(final Path file); @Override Set<Algorithm> getKeys(final Path file, final LoginCallback prompt); static final Algorithm SSE_KMS_DEFAULT; }