Package com.amazonaws.encryptionsdk
Class CryptoResult<T,K extends MasterKey<K>>
- java.lang.Object
-
- com.amazonaws.encryptionsdk.CryptoResult<T,K>
-
- Type Parameters:
T
- the type of the underlyingresult
K
- the type of theMasterKey
s used in production of this result
public class CryptoResult<T,K extends MasterKey<K>> extends Object
Represents the result of an operation byAwsCrypto
. It not only captures theresult
of the operation but also additional metadata such as theencryptionContext
,algorithm
,MasterKey
(s), and any other information captured in theCiphertextHeaders
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CryptoAlgorithm
getCryptoAlgorithm()
Convenience method equivalent togetHeaders()
.getCryptoAlgoId()
.Map<String,String>
getEncryptionContext()
CiphertextHeaders
getHeaders()
List<String>
getMasterKeyIds()
Convenience method for retrieving the keyIds in the results fromgetMasterKeys()
.List<K>
getMasterKeys()
Returns all relevantMasterKey
s.T
getResult()
The actual result of the cryptographic operation.
-
-
-
Method Detail
-
getResult
public T getResult()
The actual result of the cryptographic operation. This is not a defensive copy and callers should not modify it.- Returns:
-
getMasterKeys
public List<K> getMasterKeys()
Returns all relevantMasterKey
s. In the case of encryption, returns allMasterKey
s used to protect the ciphertext. In the case of decryption, returns just theMasterKey
used to decrypt the ciphertext.- Returns:
-
getMasterKeyIds
public List<String> getMasterKeyIds()
Convenience method for retrieving the keyIds in the results fromgetMasterKeys()
.
-
getCryptoAlgorithm
public CryptoAlgorithm getCryptoAlgorithm()
Convenience method equivalent togetHeaders()
.getCryptoAlgoId()
.
-
getHeaders
public CiphertextHeaders getHeaders()
-
-