Module org.refcodes.forwardsecrecy
Package org.refcodes.forwardsecrecy
Interface CipherVersionFactory<CV extends CipherVersion>
- Type Parameters:
CV
- The type of theCipherVersion
to be created.
- All Known Implementing Classes:
CipherVersionFactoryImpl
public interface CipherVersionFactory<CV extends CipherVersion>
extends org.refcodes.factory.ContextLookupFactory<CV,String,String>
As requirements might arise to use
CipherVersion
instances with
additional attributes or functionality; the CipherVersionFactory
can
be replaced with a custom implementation instantiating CipherVersion
(sub-)types with the additional required attributes or functionality.
Additional attributes might be a validity date useful for housekeeping or
management purposes.
In case you provide your custom CipherVersionFactory
implementation,
make sure the cipher version (sub-)type you return fits with the
CipherVersion
(sub-)type of your custom
CipherVersionGenerator
. A good approach is to make your custom
CipherVersionGenerator
make use your custom
CipherVersionFactory
.
See the default implementations CipherVersionGeneratorImpl
, the
AbstractCipherVersionGenerator
and the
CipherVersionFactoryImpl
.
-
Method Summary
Modifier and TypeMethodDescriptioncreateInstance
(String aCipherUid, String aCipher) Factory method to be implemented by subclasses.Methods inherited from interface org.refcodes.factory.ContextLookupFactory
createInstance
-
Method Details
-
createInstance
Factory method to be implemented by subclasses. Required to create implementation dependentCipherVersion
objects.- Specified by:
createInstance
in interfaceorg.refcodes.factory.ContextLookupFactory<CV extends CipherVersion,
String, String> - Parameters:
aCipherUid
- The UID for the cipher to be stored in theCipherVersion
aCipher
- The cipher to be stored in theCipherVersion
.- Returns:
- The
CipherVersion
with the cipher UID and the cipher
-