Class AbstractDecryptionService

    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractDecryptionService​(java.lang.String aNamespace, DecryptionServer aDecryptionServer)
      Constructs the service with the required services and configuration.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract java.lang.String createMessage​()
      Creates a message for which a signature is to be created in order to authenticate for the retrieval of the cipher versions.
      java.util.List<CipherVersion> getCipherVersions​()
      Returns the currently available cipher versions.
      void setCipherVersionsExpireTimeInMs​(long aCipherVersionsExpireTimeInMs)
      Injection method for setting the the expire time (in milliseconds) after which once loaded cipher versions expire.
      protected abstract <CV extends CipherVersion>
      CV
      toDecryptedCipherVersion​(CV aEncyrptedCipherVersion)
      Hook factory method to be implemented by subclasses.
      protected abstract java.lang.String toSignature​(java.lang.String aMessage)
      Creates a signature for the given message.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractDecryptionService

        public AbstractDecryptionService​(java.lang.String aNamespace,
                                         DecryptionServer aDecryptionServer)
        Constructs the service with the required services and configuration. The cipher versions expire time is set to 0 (expire immediately). See setCipherVersionsExpireTimeInMs(long).
        Parameters:
        aNamespace - The name space to which service belongs
        aDecryptionServer - The server to which the service is being "connected"
    • Method Detail

      • getCipherVersions

        public java.util.List<CipherVersion> getCipherVersions​()
        Returns the currently available cipher versions.
        Specified by:
        getCipherVersions in interface DecryptionService
        Returns:
        A list with the currently known cipher versions.
      • setCipherVersionsExpireTimeInMs

        public void setCipherVersionsExpireTimeInMs​(long aCipherVersionsExpireTimeInMs)
        Injection method for setting the the expire time (in milliseconds) after which once loaded cipher versions expire. A value of 0 indicates that them cipher versions are always reloaded upon accessing the cipher versions. A value of -1 indicates that the cipher versions are just loaded once and then never reloaded (them never expire).
        Parameters:
        aCipherVersionsExpireTimeInMs - The time in milliseconds after which them loaded cipher versions expire and are reloaded. A value of 0 indicates that them cipher versions expire immediately. A value of -1 indicate that them cipher versions expire never.
      • toSignature

        protected abstract java.lang.String toSignature​(java.lang.String aMessage)
        Creates a signature for the given message.
        Parameters:
        aMessage - The message for which a signature is to be generated
        Returns:
        The signature for the message
      • createMessage

        protected abstract java.lang.String createMessage​()
        Creates a message for which a signature is to be created in order to authenticate for the retrieval of the cipher versions. A decryption server should deny any requests to get cipher versions in case the same message is used twice.
        Returns:
        The message
      • toDecryptedCipherVersion

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