Class RawKeyring
- java.lang.Object
-
- software.amazon.encryption.s3.materials.S3Keyring
-
- software.amazon.encryption.s3.materials.RawKeyring
-
- All Implemented Interfaces:
Keyring
- Direct Known Subclasses:
AesKeyring
,RsaKeyring
public abstract class RawKeyring extends S3Keyring
This is an abstract base class for keyrings that use raw cryptographic keys (AES + RSA)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RawKeyring.Builder<KeyringT extends RawKeyring,BuilderT extends RawKeyring.Builder<KeyringT,BuilderT>>
Abstract builder for RawKeyring implementations.
-
Field Summary
Fields Modifier and Type Field Description protected MaterialsDescription
_materialsDescription
-
Fields inherited from class software.amazon.encryption.s3.materials.S3Keyring
_dataKeyGenerator, KEY_PROVIDER_ID
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RawKeyring(RawKeyring.Builder<?,?> builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EncryptionMaterials
modifyMaterialsForRawKeyring(EncryptionMaterials materials)
Modifies encryption materials with the keyring's materials description if present.void
warnIfEncryptionContextIsPresent(EncryptionMaterials materials)
Checks if an encryption context is present in the EncryptionMaterials and issues a warning if an encryption context is found.-
Methods inherited from class software.amazon.encryption.s3.materials.S3Keyring
areLegacyWrappingAlgorithmsEnabled, decryptDataKeyStrategies, defaultGenerateDataKey, encryptDataKeyStrategy, generateDataKeyStrategy, onDecrypt, onEncrypt
-
-
-
-
Field Detail
-
_materialsDescription
protected final MaterialsDescription _materialsDescription
-
-
Constructor Detail
-
RawKeyring
protected RawKeyring(RawKeyring.Builder<?,?> builder)
-
-
Method Detail
-
modifyMaterialsForRawKeyring
public EncryptionMaterials modifyMaterialsForRawKeyring(EncryptionMaterials materials)
Modifies encryption materials with the keyring's materials description if present. Issues a warning if encryption context is found, as it provides no security benefit for raw keyrings.- Parameters:
materials
- the encryption materials to modify- Returns:
- modified encryption materials with the keyring's materials description or original encryption materials if no materials description is set
-
warnIfEncryptionContextIsPresent
public void warnIfEncryptionContextIsPresent(EncryptionMaterials materials)
Checks if an encryption context is present in the EncryptionMaterials and issues a warning if an encryption context is found.Encryption context is not recommended for use with non-KMS keyrings as it does not provide additional security benefits and is not stored.
- Parameters:
materials
- EncryptionMaterials
-
-