Interface EncryptionProvider
-
- All Superinterfaces:
org.refcodes.security.Encrypter<java.lang.String,java.lang.String,org.refcodes.security.EncryptionException>
- All Known Implementing Classes:
EncryptionProviderImpl
public interface EncryptionProvider extends org.refcodes.security.Encrypter<java.lang.String,java.lang.String,org.refcodes.security.EncryptionException>
TheEncryptionProvider
is bound to a namespace and is being used by the business logic to encrypt data.It is merely responsible for retrieving a currently valid cipher for encrypting data. The
EncryptionProvider
does not expose the cipher though it might store it in clear text in-memory only (advanced implementations might encrypt the in-memory cipher). The (internally) retrieved cipher is requested from and provided by anEncryptionService
(on the same machine) which takes care of providing (and creating) a cipher with a cipher UID as well as publishing the accordingCipherVersion
(via theEncryptionServer
to theDecryptionServer
). As theEncryptionProvider
does not persist any data, an in-memoryCipherVersion
will only be used as long as theEncryptionProvider
is up-and-running. In case of a restart, a new cipher for encryption is requested from theEncryptionService
. Also the encryption provider can be forced to (create and to) use a next valid cipher on demand.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
nextCipherVersion()
Forces a next valid cipher to be requested and used.java.lang.String
toEncrypted(java.lang.String aText)
-
-
-
Method Detail
-
toEncrypted
java.lang.String toEncrypted(java.lang.String aText) throws org.refcodes.security.EncryptionException
- Specified by:
toEncrypted
in interfaceorg.refcodes.security.Encrypter<java.lang.String,java.lang.String,org.refcodes.security.EncryptionException>
- Throws:
org.refcodes.security.EncryptionException
-
nextCipherVersion
void nextCipherVersion()
Forces a next valid cipher to be requested and used.
-
-