Enum Class NoopEncryptionStorageManager
java.lang.Object
java.lang.Enum<NoopEncryptionStorageManager>
com.linecorp.centraldogma.server.storage.encryption.NoopEncryptionStorageManager
- All Implemented Interfaces:
SafeCloseable, EncryptionStorageManager, Serializable, AutoCloseable, Comparable<NoopEncryptionStorageManager>, java.lang.constant.Constable
public enum NoopEncryptionStorageManager
extends Enum<NoopEncryptionStorageManager>
implements EncryptionStorageManager
A no-operation implementation of
EncryptionStorageManager that does not perform any encryption.-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCurrentDekListener(String projectName, String repoName, Consumer<SecretKeyWithVersion> listener) Adds a listener that is called when the current DEK for a repository is updated or removed.voidaddSessionKeyListener(Consumer<SessionKey> listener) Adds a listener that is called when a new session key is stored.voidclose()booleancontainsMetadata(byte[] key) Returnstrueif the specified key exists.voiddeleteObjectId(byte[] metadataKey, byte[] key) Deletes the specified keys.voiddeleteRepositoryData(String projectName, String repoName) Deletes all data related to the specified project and repository.booleanenabled()Returnstrueif the encryption is enabled.booleanReturnstrueif the session cookie should be encrypted.generateSessionMasterKey(int version) Generates a new session master key.Generates a new data encryption key (DEK) and wraps it.Returns all data stored in the encryption storage manager.@Nullable SecretKeyWithVersiongetCurrentDek(String projectName, String repoName) Returns the current wrapped data encryption key (WDEK) for the specified project and repository.Returns the current session key that is derived from the current session master key.@Nullable SessionMasterKeyReturns the current session master key.@Nullable SecretKeyReturns the data encryption key (DEK) for the specified project and repository.byte[]getMetadata(byte[] metadataKey) Returns the value of the specified metadata key.byte[]getObject(byte[] key, byte[] metadataKey) Returns the object associated with the specified key.byte[]getObjectId(byte[] key, byte[] metadataKey) Returns the object ID bytes associated with the specified key.getSessionKey(int version) Returns the session key for the specified version.kekId()Returns the ID of the key encryption key (KEK).voidputObject(byte[] metadataKey, byte[] metadataValue, byte[] key, byte[] value) Stores the specified key-value object with metadata.voidputObjectId(byte[] metadataKey, byte[] metadataValue, byte[] key, byte[] value, byte @Nullable [] previousKeyToRemove) Stores the specified key-value pair with metadata.voidreencryptRepositoryData(String projectName, String repoName) Re-encrypts all data for the specified repository with the current DEK version.voidremoveCurrentDekListener(String projectName, String repoName) Removes a previously registered current DEK listener.voidremoveWdek(String projectName, String repoName, int version, boolean removeCurrent) Removes the wrapped data encryption key (WDEK) for the specified project and repository.rewrapAllKeys(Executor executor) Rewraps all wrapped data encryption keys (WDEKs) and session master keys with theEncryptionConfig.kekId()specified in the configuration.voidrotateSessionMasterKey(SessionMasterKey sessionMasterKey) Rotates the session master key.voidrotateWdek(WrappedDekDetails wdekDetails) Rotates the wrapped data encryption key (WDEK) for theWrappedDekDetails.projectName()andWrappedDekDetails.repoName().voidstoreSessionMasterKey(SessionMasterKey sessionMasterKey) Stores the session master key.voidstoreWdek(WrappedDekDetails wdekDetails) Stores the wrapped data encryption key (WDEK) for theWrappedDekDetails.projectName()andWrappedDekDetails.repoName().static NoopEncryptionStorageManagerReturns the enum constant of this class with the specified name.static NoopEncryptionStorageManager[]values()Returns an array containing the constants of this enum class, in the order they are declared.wdeks()Returns all wrapped data encryption keys (WDEKs).
-
Enum Constant Details
-
INSTANCE
Singleton instance ofNoopEncryptionStorageManager.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
enabled
public boolean enabled()Description copied from interface:EncryptionStorageManagerReturnstrueif the encryption is enabled.- Specified by:
enabledin interfaceEncryptionStorageManager
-
encryptSessionCookie
public boolean encryptSessionCookie()Description copied from interface:EncryptionStorageManagerReturnstrueif the session cookie should be encrypted.- Specified by:
encryptSessionCookiein interfaceEncryptionStorageManager
-
kekId
Description copied from interface:EncryptionStorageManagerReturns the ID of the key encryption key (KEK).- Specified by:
kekIdin interfaceEncryptionStorageManager
-
generateWdek
Description copied from interface:EncryptionStorageManagerGenerates a new data encryption key (DEK) and wraps it.- Specified by:
generateWdekin interfaceEncryptionStorageManager
-
generateSessionMasterKey
Description copied from interface:EncryptionStorageManagerGenerates a new session master key.- Specified by:
generateSessionMasterKeyin interfaceEncryptionStorageManager
-
storeSessionMasterKey
Description copied from interface:EncryptionStorageManagerStores the session master key.- Specified by:
storeSessionMasterKeyin interfaceEncryptionStorageManager
-
getCurrentSessionMasterKey
Description copied from interface:EncryptionStorageManagerReturns the current session master key.- Specified by:
getCurrentSessionMasterKeyin interfaceEncryptionStorageManager
-
getCurrentSessionKey
Description copied from interface:EncryptionStorageManagerReturns the current session key that is derived from the current session master key.- Specified by:
getCurrentSessionKeyin interfaceEncryptionStorageManager
-
getSessionKey
Description copied from interface:EncryptionStorageManagerReturns the session key for the specified version.- Specified by:
getSessionKeyin interfaceEncryptionStorageManager
-
rotateSessionMasterKey
Description copied from interface:EncryptionStorageManagerRotates the session master key.- Specified by:
rotateSessionMasterKeyin interfaceEncryptionStorageManager
-
wdeks
Description copied from interface:EncryptionStorageManagerReturns all wrapped data encryption keys (WDEKs).- Specified by:
wdeksin interfaceEncryptionStorageManager
-
getDek
Description copied from interface:EncryptionStorageManagerReturns the data encryption key (DEK) for the specified project and repository.- Specified by:
getDekin interfaceEncryptionStorageManager
-
getCurrentDek
Description copied from interface:EncryptionStorageManagerReturns the current wrapped data encryption key (WDEK) for the specified project and repository.- Specified by:
getCurrentDekin interfaceEncryptionStorageManager
-
storeWdek
Description copied from interface:EncryptionStorageManagerStores the wrapped data encryption key (WDEK) for theWrappedDekDetails.projectName()andWrappedDekDetails.repoName(). This raises an exception if the WDEK already exists.- Specified by:
storeWdekin interfaceEncryptionStorageManager
-
rotateWdek
Description copied from interface:EncryptionStorageManagerRotates the wrapped data encryption key (WDEK) for theWrappedDekDetails.projectName()andWrappedDekDetails.repoName().- Specified by:
rotateWdekin interfaceEncryptionStorageManager
-
removeWdek
Description copied from interface:EncryptionStorageManagerRemoves the wrapped data encryption key (WDEK) for the specified project and repository.- Specified by:
removeWdekin interfaceEncryptionStorageManager
-
getObject
public byte[] getObject(byte[] key, byte[] metadataKey) Description copied from interface:EncryptionStorageManagerReturns the object associated with the specified key.- Specified by:
getObjectin interfaceEncryptionStorageManager
-
getObjectId
public byte[] getObjectId(byte[] key, byte[] metadataKey) Description copied from interface:EncryptionStorageManagerReturns the object ID bytes associated with the specified key.- Specified by:
getObjectIdin interfaceEncryptionStorageManager
-
getMetadata
public byte[] getMetadata(byte[] metadataKey) Description copied from interface:EncryptionStorageManagerReturns the value of the specified metadata key.- Specified by:
getMetadatain interfaceEncryptionStorageManager
-
putObject
public void putObject(byte[] metadataKey, byte[] metadataValue, byte[] key, byte[] value) Description copied from interface:EncryptionStorageManagerStores the specified key-value object with metadata.- Specified by:
putObjectin interfaceEncryptionStorageManager
-
putObjectId
public void putObjectId(byte[] metadataKey, byte[] metadataValue, byte[] key, byte[] value, byte @Nullable [] previousKeyToRemove) Description copied from interface:EncryptionStorageManagerStores the specified key-value pair with metadata. ThepreviousKeyToRemovewill be removed.- Specified by:
putObjectIdin interfaceEncryptionStorageManager
-
containsMetadata
public boolean containsMetadata(byte[] key) Description copied from interface:EncryptionStorageManagerReturnstrueif the specified key exists.- Specified by:
containsMetadatain interfaceEncryptionStorageManager
-
deleteObjectId
public void deleteObjectId(byte[] metadataKey, byte[] key) Description copied from interface:EncryptionStorageManagerDeletes the specified keys.- Specified by:
deleteObjectIdin interfaceEncryptionStorageManager
-
deleteRepositoryData
Description copied from interface:EncryptionStorageManagerDeletes all data related to the specified project and repository.- Specified by:
deleteRepositoryDatain interfaceEncryptionStorageManager
-
reencryptRepositoryData
Description copied from interface:EncryptionStorageManagerRe-encrypts all data for the specified repository with the current DEK version. This is typically called after a DEK rotation to ensure all data is encrypted with the latest key version.- Specified by:
reencryptRepositoryDatain interfaceEncryptionStorageManager
-
getAllData
Description copied from interface:EncryptionStorageManagerReturns all data stored in the encryption storage manager.- Specified by:
getAllDatain interfaceEncryptionStorageManager
-
addSessionKeyListener
Description copied from interface:EncryptionStorageManagerAdds a listener that is called when a new session key is stored.- Specified by:
addSessionKeyListenerin interfaceEncryptionStorageManager
-
addCurrentDekListener
public void addCurrentDekListener(String projectName, String repoName, Consumer<SecretKeyWithVersion> listener) Description copied from interface:EncryptionStorageManagerAdds a listener that is called when the current DEK for a repository is updated or removed. The listener receives the project/repo key and the new DEK (or null if removed).- Specified by:
addCurrentDekListenerin interfaceEncryptionStorageManager
-
removeCurrentDekListener
Description copied from interface:EncryptionStorageManagerRemoves a previously registered current DEK listener.- Specified by:
removeCurrentDekListenerin interfaceEncryptionStorageManager
-
rewrapAllKeys
Description copied from interface:EncryptionStorageManagerRewraps all wrapped data encryption keys (WDEKs) and session master keys with theEncryptionConfig.kekId()specified in the configuration.- Specified by:
rewrapAllKeysin interfaceEncryptionStorageManager- Parameters:
executor- theExecutorto use for storing re-wrapped keys.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSafeCloseable
-