Package org.refcodes.forwardsecrecy
Class InMemoryEncryptionServer
- java.lang.Object
-
- org.refcodes.forwardsecrecy.InMemoryEncryptionServer
-
- All Implemented Interfaces:
EncryptionServer
public class InMemoryEncryptionServer extends Object implements EncryptionServer
TheInMemoryEncryptionServer
is a non-persisting implementation of theEncryptionServer
managing theCipherVersion
instances in memory only. This implementation provides means to easily set up a quick and dirty test setup. TheInMemoryDecryptionServer
is the counterpart of theInMemoryEncryptionServer
which both work (not doing any persistence) hand in hand.
-
-
Constructor Summary
Constructors Constructor Description InMemoryEncryptionServer(InMemoryDecryptionServer aDecryptionServer)
Constructs the server with the provided decryption server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCipherVersion(String aNamespace, CipherVersion aCipherVersion)
Adds aCipherVersion
to theEncryptionServer
.
-
-
-
Constructor Detail
-
InMemoryEncryptionServer
public InMemoryEncryptionServer(InMemoryDecryptionServer aDecryptionServer)
Constructs the server with the provided decryption server.- Parameters:
aDecryptionServer
- The decryption server to be used simulating a cipher repository of some kind
-
-
Method Detail
-
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.
-
-