Module org.refcodes.forwardsecrecy
Package org.refcodes.forwardsecrecy
Class InMemoryEncryptionServer
java.lang.Object
org.refcodes.forwardsecrecy.InMemoryEncryptionServer
- All Implemented Interfaces:
EncryptionServer
The
InMemoryEncryptionServer
is a non-persisting implementation of
the EncryptionServer
managing the CipherVersion
instances in
memory only. This implementation provides means to easily set up a quick and
dirty test setup. The InMemoryDecryptionServer
is the counterpart of
the InMemoryEncryptionServer
which both work (not doing any
persistence) hand in hand.-
Constructor Summary
ConstructorDescriptionInMemoryEncryptionServer
(InMemoryDecryptionServer aDecryptionServer) Constructs the server with the provided decryption server. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCipherVersion
(String aNamespace, CipherVersion aCipherVersion) Adds aCipherVersion
to theEncryptionServer
.
-
Constructor Details
-
InMemoryEncryptionServer
Constructs the server with the provided decryption server.- Parameters:
aDecryptionServer
- The decryption server to be used simulating a cipher repository of some kind
-
-
Method Details
-
addCipherVersion
public void addCipherVersion(String aNamespace, CipherVersion aCipherVersion) throws CipherUidAlreadyInUseException Adds aCipherVersion
to theEncryptionServer
.- Specified by:
addCipherVersion
in interfaceEncryptionServer
- Parameters:
aNamespace
- The namespace for which to add the cipheraCipherVersion
- TheCipherVersion
to be added.- Throws:
CipherUidAlreadyInUseException
- in case the given cipher UID has already been used.
-