Interface EncryptionProvider

  • All Superinterfaces:
    org.refcodes.security.Encrypter<String,String,org.refcodes.security.EncryptionException>
    All Known Implementing Classes:
    EncryptionProviderImpl


    public interface EncryptionProvider
    extends org.refcodes.security.Encrypter<String,String,org.refcodes.security.EncryptionException>
    The EncryptionProvider 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 an EncryptionService (on the same machine) which takes care of providing (and creating) a cipher with a cipher UID as well as publishing the according CipherVersion (via the EncryptionServer to the DecryptionServer). As the EncryptionProvider does not persist any data, an in-memory CipherVersion will only be used as long as the EncryptionProvider is up-and-running. In case of a restart, a new cipher for encryption is requested from the EncryptionService. Also the encryption provider can be forced to (create and to) use a next valid cipher on demand.

    • Method Detail

      • toEncrypted

        String toEncrypted​(String aText)
                    throws org.refcodes.security.EncryptionException
        Specified by:
        toEncrypted in interface org.refcodes.security.Encrypter<String,String,org.refcodes.security.EncryptionException>
        Throws:
        org.refcodes.security.EncryptionException
      • nextCipherVersion

        void nextCipherVersion​()
        Forces a next valid cipher to be requested and used.