Class PublicKeyDecryptionServiceImpl

    • Constructor Detail

      • PublicKeyDecryptionServiceImpl

        public PublicKeyDecryptionServiceImpl​(java.lang.String aNamespace,
                                              java.lang.String aPrivateKeyPath,
                                              DecryptionServer aDecryptionServer,
                                              CipherVersionFactory<CipherVersion> aCipherVersionFactory)
                                       throws edu.vt.middleware.crypt.CryptException,
                                              java.io.IOException
        Constructs the service with the required services and configuration.
        Parameters:
        aPrivateKeyPath - The path on the file system to the private key to be used for decrypting any ciphers passed by the decryption server in CipherVersions retrieved from a storage.
        aDecryptionServer - The decryption server for accessing the cipher versions
        aCipherVersionFactory - The factory to be used for creating CipherVersion instances.
        Throws:
        java.io.IOException - in case of I/O problems
        edu.vt.middleware.crypt.CryptException - in case the cryptography algorithm had problems.
      • PublicKeyDecryptionServiceImpl

        public PublicKeyDecryptionServiceImpl​(java.lang.String aNamespace,
                                              java.lang.String aPrivateKeyPath,
                                              DecryptionServer aDecryptionServer)
                                       throws edu.vt.middleware.crypt.CryptException,
                                              java.io.IOException
        Constructs the service with the required services and configuration.
        Parameters:
        aPrivateKeyPath - The path on the file system to the private key to be used for decrypting any ciphers passed by the decryption server in CipherVersions retrieved from a storage.
        aDecryptionServer - The decryption server for accessing the cipher versions
        Throws:
        java.io.IOException - in case of I/O problems
        edu.vt.middleware.crypt.CryptException - in case the cryptography algorithm had problems.
      • PublicKeyDecryptionServiceImpl

        public PublicKeyDecryptionServiceImpl​(java.lang.String aNamespace,
                                              java.lang.String aPrivateKeyPath,
                                              java.lang.String aPrivateKeyPassPhrase,
                                              DecryptionServer aDecryptionServer)
                                       throws edu.vt.middleware.crypt.CryptException,
                                              java.io.IOException
        Constructs the service with the required services and configuration.
        Parameters:
        aPrivateKeyPath - The path on the file system to the private key to be used for decrypting any ciphers passed by the decryption server in CipherVersions retrieved from a storage.
        aPrivateKeyPassPhrase - The pass phrase for decrypting the private key.
        aDecryptionServer - The decryption server for accessing the cipher versions
        Throws:
        java.io.IOException - in case of I/O problems
        edu.vt.middleware.crypt.CryptException - in case the cryptography algorithm had problems.
      • PublicKeyDecryptionServiceImpl

        public PublicKeyDecryptionServiceImpl​(java.lang.String aNamespace,
                                              java.lang.String aPrivateKeyPath,
                                              java.lang.String aPrivateKeyPassPhrase,
                                              DecryptionServer aDecryptionServer,
                                              CipherVersionFactory<CipherVersion> aCipherVersionFactory)
                                       throws edu.vt.middleware.crypt.CryptException,
                                              java.io.IOException
        Constructs the service with the required services and configuration.
        Parameters:
        aPrivateKeyPath - The path on the file system to the private key to be used for decrypting any ciphers passed by the decryption server in CipherVersions retrieved from a storage.
        aPrivateKeyPassPhrase - The pass phrase for decrypting the private key.
        aDecryptionServer - The decryption server for accessing the cipher versions
        aCipherVersionFactory - The factory to be used for creating CipherVersion instances.
        Throws:
        java.io.IOException - in case of I/O problems
        edu.vt.middleware.crypt.CryptException - in case the cryptography algorithm had problems.
    • Method Detail

      • toSignature

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

        protected 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.
        Specified by:
        createMessage in class AbstractDecryptionService
        Returns:
        The message
      • toDecryptedCipherVersion

        protected <CV extends CipherVersion> CV toDecryptedCipherVersion​(CV aEncyrptedCipherVersion)
        To decrypted cipher version.
        Specified by:
        toDecryptedCipherVersion in class AbstractDecryptionService
        Type Parameters:
        CV - the generic type
        Parameters:
        aEncyrptedCipherVersion - the encyrpted cipher version
        Returns:
        the cv