Class PublicKeyDecryptionService

    • Constructor Detail

      • PublicKeyDecryptionService

        public PublicKeyDecryptionService​(String aNamespece,
                                          String aPrivateKeyPath,
                                          DecryptionServer aDecryptionServer,
                                          CipherVersionFactory<CipherVersion> aCipherVersionFactory)
                                   throws edu.vt.middleware.crypt.CryptException,
                                          IOException,
                                          InvalidKeySpecException,
                                          NoSuchAlgorithmException
        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:
        IOException - in case of I/O problems
        edu.vt.middleware.crypt.CryptException - in case the cryptography algorithm had problems.
        NoSuchAlgorithmException - thrown in case the cryptographic algorithm was not found.
        InvalidKeySpecException - thrown in case an invalid key spec has been encountered.
      • PublicKeyDecryptionService

        public PublicKeyDecryptionService​(String aNamespece,
                                          String aPrivateKeyPath,
                                          DecryptionServer aDecryptionServer)
                                   throws edu.vt.middleware.crypt.CryptException,
                                          IOException,
                                          InvalidKeySpecException,
                                          NoSuchAlgorithmException
        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:
        IOException - in case of I/O problems
        edu.vt.middleware.crypt.CryptException - in case the cryptography algorithm had problems.
        NoSuchAlgorithmException - thrown in case the cryptographic algorithm was not found.
        InvalidKeySpecException - thrown in case an invalid key spec has been encountered.
      • PublicKeyDecryptionService

        public PublicKeyDecryptionService​(String aNamespece,
                                          String aPrivateKeyPath,
                                          String aPrivateKeyPassPhrase,
                                          DecryptionServer aDecryptionServer)
                                   throws edu.vt.middleware.crypt.CryptException,
                                          IOException,
                                          InvalidKeySpecException,
                                          NoSuchAlgorithmException
        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:
        IOException - in case of I/O problems
        edu.vt.middleware.crypt.CryptException - in case the cryptography algorithm had problems.
        NoSuchAlgorithmException - thrown in case the cryptographic algorithm was not found.
        InvalidKeySpecException - thrown in case an invalid key spec has been encountered.
      • PublicKeyDecryptionService

        public PublicKeyDecryptionService​(String aNamespece,
                                          String aPrivateKeyPath,
                                          String aPrivateKeyPassPhrase,
                                          DecryptionServer aDecryptionServer,
                                          CipherVersionFactory<CipherVersion> aCipherVersionFactory)
                                   throws edu.vt.middleware.crypt.CryptException,
                                          IOException,
                                          InvalidKeySpecException,
                                          NoSuchAlgorithmException
        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:
        IOException - in case of I/O problems
        edu.vt.middleware.crypt.CryptException - in case the cryptography algorithm had problems.
        NoSuchAlgorithmException - thrown in case the cryptographic algorithm was not found.
        InvalidKeySpecException - thrown in case an invalid key spec has been encountered.
    • Method Detail

      • toSignature

        protected String toSignature​(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 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