curena
8/27/2015 - 6:33 PM

AWS KMS decryptRequest in Java

AWS KMS decryptRequest in Java

DecryptRequest decryptRequest = new DecryptRequest();
decryptRequest.setCiphertextBlob(encryptedKey);
 

// call AWS KMS to decrypt the key
DecryptResult decryptResult = kmsClient.decrypt(decryptRequest);
// parse out the decryption result
String strKeyId = decryptResult.getKeyId();
ByteBuffer plaintextKey = decryptResult.getPlaintext();