Class EncryptionExecutor
java.lang.Object
io.confluent.kafka.schemaregistry.encryption.EncryptionExecutor
- All Implemented Interfaces:
RuleBase,RuleExecutor,AutoCloseable,org.apache.kafka.common.Configurable,org.apache.kafka.common.metrics.Monitorable
In envelope encryption, a user generates a data encryption key (DEK) locally, encrypts data with
the DEK, sends the DEK to a KMS to be encrypted (with a key managed by KMS - KEK), and then
stores the encrypted DEK. At a later point, a user can retrieve the encrypted DEK for the
encrypted data, use the KEK from KMS to decrypt the DEK, and use the decrypted DEK to decrypt
the data.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassstatic enumField-level decryption outcome recorded underMETA_STATUSduring deserialization. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final byte[]static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final intprotected static final bytestatic final StringPer-field metadata key for the DEK version that decrypted the field.static final StringPer-field metadata key for the failure message when status is FAILED.static final StringPer-field metadata key for the KEK name resolved for the field.static final StringPer-field metadata key set by this executor inRuleResult.fieldMetadata().get(fieldPath).protected static final intstatic final Stringprotected static final intFields inherited from interface io.confluent.kafka.schemaregistry.rules.RuleBase
DEFAULT_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidclose()voidprotected byte[]generateDek(DekFormat dekFormat) newTransform(RuleContext ctx) voidsetSchemaRegistryClient(SchemaRegistryClient schemaRegistryClient) transform(RuleContext ctx, Object message) type()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.confluent.kafka.schemaregistry.rules.RuleBase
withPluginMetrics
-
Field Details
-
TYPE
- See Also:
-
META_STATUS
Per-field metadata key set by this executor inRuleResult.fieldMetadata().get(fieldPath). The value is the name of aEncryptionExecutor.Statusenum constant (e.g."DECRYPTED").- See Also:
-
META_KEK_NAME
Per-field metadata key for the KEK name resolved for the field.- See Also:
-
META_DEK_VERSION
Per-field metadata key for the DEK version that decrypted the field.- See Also:
-
META_ERROR_MESSAGE
Per-field metadata key for the failure message when status is FAILED.- See Also:
-
ENCRYPT_KEK_NAME
- See Also:
-
ENCRYPT_KMS_KEY_ID
- See Also:
-
ENCRYPT_KMS_TYPE
- See Also:
-
ENCRYPT_DEK_ALGORITHM
- See Also:
-
ENCRYPT_DEK_EXPIRY_DAYS
- See Also:
-
ENCRYPT_ALTERNATE_KMS_KEY_IDS
- See Also:
-
ENCRYPT_NONSHARED_KEK_PASSTHROUGH
- See Also:
-
KMS_TYPE_SUFFIX
- See Also:
-
EMPTY_AAD
public static final byte[] EMPTY_AAD -
CACHE_EXPIRY_SECS
- See Also:
-
CACHE_SIZE
- See Also:
-
CLOCK
- See Also:
-
LATEST_VERSION
protected static final int LATEST_VERSION- See Also:
-
MAGIC_BYTE
protected static final byte MAGIC_BYTE- See Also:
-
MILLIS_IN_DAY
protected static final int MILLIS_IN_DAY- See Also:
-
VERSION_SIZE
protected static final int VERSION_SIZE- See Also:
-
-
Constructor Details
-
EncryptionExecutor
public EncryptionExecutor()
-
-
Method Details
-
addOriginalConfigs
public boolean addOriginalConfigs()- Specified by:
addOriginalConfigsin interfaceRuleBase
-
setSchemaRegistryClient
- Specified by:
setSchemaRegistryClientin interfaceRuleBase
-
configure
-
type
-
transform
- Specified by:
transformin interfaceRuleExecutor- Throws:
RuleException
-
newTransform
public EncryptionExecutor.EncryptionExecutorTransform newTransform(RuleContext ctx) throws RuleException - Throws:
RuleException
-
getCryptors
-
generateDek
- Throws:
GeneralSecurityException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceRuleBase- Throws:
RuleException
-