Package org.refcodes.forwardsecrecy
Class InMemoryEncryptionServerImpl
- java.lang.Object
-
- org.refcodes.forwardsecrecy.InMemoryEncryptionServerImpl
-
- All Implemented Interfaces:
EncryptionServer
public class InMemoryEncryptionServerImpl extends java.lang.Object implements EncryptionServer
TheInMemoryEncryptionServerImpl
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. TheInMemoryDecryptionServerImpl
is the counterpart of theInMemoryEncryptionServerImpl
which both work (not doing any persistence) hand in hand.
-
-
Constructor Summary
Constructors Constructor Description InMemoryEncryptionServerImpl(InMemoryDecryptionServerImpl aDecryptionServer)
Constructs the server with the provided decryption server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCipherVersion(java.lang.String aNamespace, CipherVersion aCipherVersion)
Adds aCipherVersion
to theEncryptionServer
.
-
-
-
Constructor Detail
-
InMemoryEncryptionServerImpl
public InMemoryEncryptionServerImpl(InMemoryDecryptionServerImpl 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(java.lang.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.
-
-