Java Code Examples for com.amazonaws.services.kms.model.DecryptRequest#withEncryptionAlgorithm()
The following examples show how to use
com.amazonaws.services.kms.model.DecryptRequest#withEncryptionAlgorithm() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AsymmetricEncryptionAlgorithmTest.java From spring-cloud-config-aws-kms with Apache License 2.0 | 5 votes |
@Test void testDecryptAsymmetricProperty() { assertThat(decryptedSecret1).isEqualTo(PLAINTEXT); final DecryptRequest decryptRequest = new DecryptRequest(); decryptRequest.withCiphertextBlob(CIPHER_TEXT_BLOB1); decryptRequest.withEncryptionAlgorithm(RSAES_OAEP_SHA_1); decryptRequest.withKeyId("asymmetric-sha1-sample-key"); verify(mockKms, atLeastOnce()).decrypt(eq(decryptRequest)); }
Example 2
Source File: AsymmetricEncryptionAlgorithmTest.java From spring-cloud-config-aws-kms with Apache License 2.0 | 5 votes |
@Test void testAlgorithmsCanBeMixed() { assertThat(decryptedSecret2).isEqualTo(PLAINTEXT); final DecryptRequest decryptRequest = new DecryptRequest(); decryptRequest.withCiphertextBlob(CIPHER_TEXT_BLOB2); decryptRequest.withEncryptionAlgorithm(SYMMETRIC_DEFAULT); verify(mockKms, atLeastOnce()).decrypt(eq(decryptRequest)); }
Example 3
Source File: AsymmetricEncryptionAlgorithmTest.java From spring-cloud-config-aws-kms with Apache License 2.0 | 5 votes |
@Test void testSecretWithCustomKeyId() { assertThat(decryptedSecret3).isEqualTo(PLAINTEXT); final DecryptRequest decryptRequest = new DecryptRequest(); decryptRequest.withCiphertextBlob(CIPHER_TEXT_BLOB3); decryptRequest.withEncryptionAlgorithm(RSAES_OAEP_SHA_256); decryptRequest.withKeyId("different-key"); verify(mockKms, atLeastOnce()).decrypt(eq(decryptRequest)); }