@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(new HostPreferences(session.getHost()).getProperty(key))) {
                return Algorithm.fromString(new HostPreferences(session.getHost()).getProperty(key));
            }
        }
        return super.getEncryption(file);
    }
@Test
    public void testSetEncryptionKMSCustomKeySignatureVersionV4() throws Exception {
        final Path container = new Path("test-eu-west-1-cyberduck", EnumSet.of(Path.Type.volume, Path.Type.directory));
        final Path test = new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
        new S3TouchFeature(session, new S3AccessControlListFeature(session)).touch(test, new TransferStatus());
        final S3EncryptionFeature feature = new S3EncryptionFeature(session, new S3AccessControlListFeature(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.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }