Class AbstractEncryptionService

    • Constructor Detail

      • AbstractEncryptionService

        public AbstractEncryptionService​(java.lang.String aNamespace,
                                         EncryptionServer aEncryptionServer,
                                         CipherVersionGenerator<CipherVersion> aCipherVersionGenerator)
        Constructs the service with the required services and configuration.
        Parameters:
        aNamespace - The name space to which this service belongs
        aEncryptionServer - The server to which the service is being "connected"
        aCipherVersionGenerator - The generator to be used for generating CipherVersion instances.
    • Method Detail

      • next

        public CipherVersion next()
        Generator method to be implemented by subclasses. Required to create implementation dependent cipher version objects. Retrieves the next valid cipher which may be used for encrypting data.
        Specified by:
        next in interface CipherVersionGenerator<CipherVersion>
        Specified by:
        next in interface org.refcodes.generator.Generator<CipherVersion>
        Specified by:
        next in interface java.util.Iterator<CipherVersion>
        Returns:
        The next valid CipherVersion for encryption.
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface org.refcodes.generator.Generator<CipherVersion>
        Specified by:
        hasNext in interface java.util.Iterator<CipherVersion>
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<CipherVersion>
      • toEncryptedCipherVersion

        protected abstract <CV extends CipherVersion> CV toEncryptedCipherVersion​(CV aDecyrptedCipherVersion)
        Hook factory method to be implemented by subclasses. The provided cipher is to be encrypted (e.g. with the public key of an asymmetric encryption approach) so that an Encryption-Server only receives encrypted data.
        Type Parameters:
        CV - The type of the CipherVersion to be used.
        Parameters:
        aDecyrptedCipherVersion - The CipherVersion to be encrypted.
        Returns:
        The encrypted CipherVersion.