@Test void testFailEncryptPathWithBrokenEncryptedPath() { AuthPathEncryptionSecretKey pathEncryptionSecretKey = pathEncryptionSecretKey(); assertThrows(BadPaddingException.class, () -> symmetricPathEncryptionService.decrypt(pathEncryptionSecretKey, new Uri(URI.create("bRQiW8qLNPEy5tO7shfV0w==/k0HooCVlmhHkQFw8mc==")))); }
@Override @SneakyThrows public Uri decrypt(AuthPathEncryptionSecretKey pathEncryptionSecretKey, Uri bucketPath) { validateArgs(pathEncryptionSecretKey, bucketPath); validateUriIsRelative(bucketPath); bucketPath = AES_SIV.asUriRoot().relativize(bucketPath); return processURIparts( pathEncryptionSecretKey, bucketPath, decryptAndDecode ); }
IntegrityPreservingUriEncryption implements SymmetricPathEncryptionService { @Override @SneakyThrows public Uri decrypt(AuthPathEncryptionSecretKey pathEncryptionSecretKey, Uri bucketPath) { validateArgs(pathEncryptionSecretKey, bucketPath); validateUriIsRelative(bucketPath); bucketPath = AES_SIV.asUriRoot().relativize(bucketPath); return processURIparts( pathEncryptionSecretKey, bucketPath, decryptAndDecode ); } }
IntegrityPreservingUriEncryption implements SymmetricPathEncryptionService { @Override @SneakyThrows public Uri decrypt(AuthPathEncryptionSecretKey pathEncryptionSecretKey, Uri bucketPath) { validateArgs(pathEncryptionSecretKey, bucketPath); validateUriIsRelative(bucketPath); bucketPath = AES_SIV.asUriRoot().relativize(bucketPath); return processURIparts( pathEncryptionSecretKey, bucketPath, decryptAndDecode ); } @Inject  IntegrityPreservingUriEncryption(PathEncryptorDecryptor pathEncryptorDecryptor); }
IntegrityPreservingUriEncryption implements SymmetricPathEncryptionService { @Override @SneakyThrows public Uri decrypt(AuthPathEncryptionSecretKey pathEncryptionSecretKey, Uri bucketPath) { validateArgs(pathEncryptionSecretKey, bucketPath); validateUriIsRelative(bucketPath); bucketPath = AES_SIV.asUriRoot().relativize(bucketPath); return processURIparts( pathEncryptionSecretKey, bucketPath, decryptAndDecode ); } @Inject  IntegrityPreservingUriEncryption(PathEncryptorDecryptor pathEncryptorDecryptor); @Override @SneakyThrows Uri encrypt(AuthPathEncryptionSecretKey pathEncryptionSecretKey, Uri bucketPath); @Override @SneakyThrows Uri decrypt(AuthPathEncryptionSecretKey pathEncryptionSecretKey, Uri bucketPath); }
IntegrityPreservingUriEncryption implements SymmetricPathEncryptionService { @Override @SneakyThrows public Uri decrypt(AuthPathEncryptionSecretKey pathEncryptionSecretKey, Uri bucketPath) { validateArgs(pathEncryptionSecretKey, bucketPath); validateUriIsRelative(bucketPath); bucketPath = AES_SIV.asUriRoot().relativize(bucketPath); return processURIparts( pathEncryptionSecretKey, bucketPath, decryptAndDecode ); } @Inject  IntegrityPreservingUriEncryption(PathEncryptorDecryptor pathEncryptorDecryptor); @Override @SneakyThrows Uri encrypt(AuthPathEncryptionSecretKey pathEncryptionSecretKey, Uri bucketPath); @Override @SneakyThrows Uri decrypt(AuthPathEncryptionSecretKey pathEncryptionSecretKey, Uri bucketPath);  }