Class SegstoreRaftLogEntryEncryptor
java.lang.Object
org.gridgain.internal.encryption.raftlog.SegstoreRaftLogEntryEncryptor
- All Implemented Interfaces:
org.apache.ignite.internal.lang.Debuggable,org.apache.ignite.internal.manager.IgniteComponent,org.apache.ignite.internal.raft.storage.segstore.LogEntryEncryptor
public class SegstoreRaftLogEntryEncryptor
extends Object
implements org.apache.ignite.internal.raft.storage.segstore.LogEntryEncryptor, org.apache.ignite.internal.manager.IgniteComponent
LogEntryEncryptor implementation for the "Segstore" Raft log.
Each Raft group gets its own data encryption key chain, keyed by the group id and stored in the Vault under a raft-specific prefix. Keys are created lazily when a group's log storage is created and dropped when it is destroyed.
An encrypted entry is laid out as [magic(1)][keyId(4, LE)][plaintextLength(4, LE)][IV][ciphertext], where
the ciphertext is the AES-encrypted output of the base codec. The key id lets the right key be selected across key rotations; the
plaintext length lets the decoder strip block-cipher padding. The magic byte distinguishes encrypted entries from plaintext ones, so both
can coexist in a segment file.
-
Field Summary
Fields inherited from interface org.apache.ignite.internal.lang.Debuggable
INDENTATION -
Constructor Summary
ConstructorsConstructorDescriptionSegstoreRaftLogEntryEncryptor(org.apache.ignite.internal.vault.VaultManager vaultManager, Supplier<org.gridgain.internal.encryption.EncryptionManager> encryptionManagerSupplier, org.apache.ignite.internal.failure.FailureProcessor failureProcessor) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.gridgain.internal.encryption.DataEncryptionKeyManagerbooleanenabled()voidensureGroupKey(long groupId) voidonGroupDestroyed(long groupId) startAsync(org.apache.ignite.internal.manager.ComponentContext componentContext) stopAsync(org.apache.ignite.internal.manager.ComponentContext componentContext) org.apache.ignite.raft.jraft.entity.codec.LogEntryDecoderwrapDecoder(org.apache.ignite.raft.jraft.entity.codec.LogEntryDecoder decoder, long groupId) org.apache.ignite.raft.jraft.entity.codec.LogEntryEncoderwrapEncoder(org.apache.ignite.raft.jraft.entity.codec.LogEntryEncoder encoder, long groupId) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.ignite.internal.lang.Debuggable
dumpStateMethods inherited from interface org.apache.ignite.internal.manager.IgniteComponent
stopAsync
-
Constructor Details
-
SegstoreRaftLogEntryEncryptor
public SegstoreRaftLogEntryEncryptor(org.apache.ignite.internal.vault.VaultManager vaultManager, Supplier<org.gridgain.internal.encryption.EncryptionManager> encryptionManagerSupplier, org.apache.ignite.internal.failure.FailureProcessor failureProcessor) Constructor.- Parameters:
vaultManager- Vault manager used to persist the (KEK-wrapped) data encryption key chains.encryptionManagerSupplier- Supplier of the encryption manager (resolved on start).failureProcessor- Failure processor used to handle critical errors.
-
-
Method Details
-
startAsync
public CompletableFuture<Void> startAsync(org.apache.ignite.internal.manager.ComponentContext componentContext) - Specified by:
startAsyncin interfaceorg.apache.ignite.internal.manager.IgniteComponent
-
beforeNodeStop
public void beforeNodeStop()- Specified by:
beforeNodeStopin interfaceorg.apache.ignite.internal.manager.IgniteComponent
-
stopAsync
public CompletableFuture<Void> stopAsync(org.apache.ignite.internal.manager.ComponentContext componentContext) - Specified by:
stopAsyncin interfaceorg.apache.ignite.internal.manager.IgniteComponent
-
enabled
public boolean enabled()- Specified by:
enabledin interfaceorg.apache.ignite.internal.raft.storage.segstore.LogEntryEncryptor
-
wrapEncoder
public org.apache.ignite.raft.jraft.entity.codec.LogEntryEncoder wrapEncoder(org.apache.ignite.raft.jraft.entity.codec.LogEntryEncoder encoder, long groupId) - Specified by:
wrapEncoderin interfaceorg.apache.ignite.internal.raft.storage.segstore.LogEntryEncryptor
-
wrapDecoder
public org.apache.ignite.raft.jraft.entity.codec.LogEntryDecoder wrapDecoder(org.apache.ignite.raft.jraft.entity.codec.LogEntryDecoder decoder, long groupId) - Specified by:
wrapDecoderin interfaceorg.apache.ignite.internal.raft.storage.segstore.LogEntryEncryptor
-
ensureGroupKey
public void ensureGroupKey(long groupId) - Specified by:
ensureGroupKeyin interfaceorg.apache.ignite.internal.raft.storage.segstore.LogEntryEncryptor
-
onGroupDestroyed
public void onGroupDestroyed(long groupId) - Specified by:
onGroupDestroyedin interfaceorg.apache.ignite.internal.raft.storage.segstore.LogEntryEncryptor
-
dataEncryptionKeyManager
@TestOnly public org.gridgain.internal.encryption.DataEncryptionKeyManager dataEncryptionKeyManager()
-