DecryptionServer
public class PublicKeyDecryptionServerWrapper extends Object implements DecryptionServer
DecryptionServer
, provides support for an
asymmetric encryption approach. The retrieved cipher versions are decrypted
with the provided private key and encrypted with a public key matching one of
the public keys. This wrapper assumes that the wrapped decryption server
passes encrypted ciphers in its cipher versions.Constructor | Description |
---|---|
PublicKeyDecryptionServerWrapper(String aPrivateKeyPath,
String aPrivateKeyPassPhrase,
String aPublicKeysPath,
DecryptionServer aDecryptionServer) |
Constructs the service with the required configuration.
|
PublicKeyDecryptionServerWrapper(String aPrivateKeyPath,
String aPrivateKeyPassPhrase,
String aPublicKeysPath,
DecryptionServer aDecryptionServer,
CipherVersionFactory<CipherVersion> aCipherVersionFactory) |
Constructs the service with the required configuration.
|
PublicKeyDecryptionServerWrapper(String aPrivateKeyPath,
String aPublicKeysPath,
DecryptionServer aDecryptionServer) |
Constructs the service with the required configuration.
|
PublicKeyDecryptionServerWrapper(String aPrivateKeyPath,
String aPublicKeysPath,
DecryptionServer aDecryptionServer,
CipherVersionFactory<CipherVersion> aCipherVersionFactory) |
Constructs the service with the required configuration.
|
Modifier and Type | Method | Description |
---|---|---|
List<CipherVersion> |
getCipherVersions(String aNamespace,
String aMessage,
String aSignature) |
Returns the currently available cipher versions.
|
public PublicKeyDecryptionServerWrapper(String aPrivateKeyPath, String aPublicKeysPath, DecryptionServer aDecryptionServer, CipherVersionFactory<CipherVersion> aCipherVersionFactory) throws CryptException, IOException, InvalidKeySpecException, NoSuchAlgorithmException
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.aPublicKeysPath
- The folder in which the public keys reside. As
there may be multiple files of which some are not public keys,
files which do not have the suffix "*.pem" and which have not the
term "pub" inside, are ignored.aDecryptionServer
- The decryption server from which to retrieve the
cipher versionsaCipherVersionFactory
- The factory to be used for creating
CipherVersion
instances.CryptException
- in case the cryptography algorithm had problems.IOException
- in case of I/O problemsNoSuchAlgorithmException
- thrown in case the cryptographic
algorithm was not found.InvalidKeySpecException
- thrown in case an invalid key spec has
been encountered.public PublicKeyDecryptionServerWrapper(String aPrivateKeyPath, String aPublicKeysPath, DecryptionServer aDecryptionServer) throws CryptException, IOException, InvalidKeySpecException, NoSuchAlgorithmException
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.aPublicKeysPath
- The folder in which the public keys reside. As
there may be multiple files of which some are not public keys,
files which do not have the suffix "*.pem" and which have not the
term "pub" inside, are ignored.aDecryptionServer
- The decryption server from which to retrieve the
cipher versionsCryptException
- in case the cryptography algorithm had problems.IOException
- in case of I/O problemsNoSuchAlgorithmException
- thrown in case the cryptographic
algorithm was not found.InvalidKeySpecException
- thrown in case an invalid key spec has
been encountered.public PublicKeyDecryptionServerWrapper(String aPrivateKeyPath, String aPrivateKeyPassPhrase, String aPublicKeysPath, DecryptionServer aDecryptionServer) throws CryptException, IOException, InvalidKeySpecException, NoSuchAlgorithmException
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.aPublicKeysPath
- The folder in which the public keys reside. As
there may be multiple files of which some are not public keys,
files which do not have the suffix "*.pem" and which have not the
term "pub" inside, are ignored.aDecryptionServer
- The decryption server from which to retrieve the
cipher versionsCryptException
- in case the cryptography algorithm had problems.IOException
- in case of I/O problemsNoSuchAlgorithmException
- thrown in case the cryptographic
algorithm was not found.InvalidKeySpecException
- thrown in case an invalid key spec has
been encountered.public PublicKeyDecryptionServerWrapper(String aPrivateKeyPath, String aPrivateKeyPassPhrase, String aPublicKeysPath, DecryptionServer aDecryptionServer, CipherVersionFactory<CipherVersion> aCipherVersionFactory) throws CryptException, IOException, InvalidKeySpecException, NoSuchAlgorithmException
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.aPublicKeysPath
- The folder in which the public keys reside. As
there may be multiple files of which some are not public keys,
files which do not have the suffix "*.pem" and which have not the
term "pub" inside, are ignored.aDecryptionServer
- The decryption server from which to retrieve the
cipher versionsaCipherVersionFactory
- The factory to be used for creating
CipherVersion
instances.CryptException
- in case the cryptography algorithm had problems.IOException
- in case of I/O problemsNoSuchAlgorithmException
- thrown in case the cryptographic
algorithm was not found.InvalidKeySpecException
- thrown in case an invalid key spec has
been encountered.public List<CipherVersion> getCipherVersions(String aNamespace, String aMessage, String aSignature) throws SignatureVerificationException
ObjectOutputStream
. Though the stream is
encrypted with the public key of the message signer.
-------------------------------------------------------------------------
Another approach might not return a stream, it might return a list
containing the cipher versions with the ciphers being encrypted by the
public key. Or a stream is returned which is not encrypted but the
ciphers in the cipher versions carried by the stream.
-------------------------------------------------------------------------getCipherVersions
in interface DecryptionServer
aNamespace
- The namespace for which to get the cipher versions.aMessage
- A message to be signed by the requester of the cipher
version.aSignature
- The signature of the requester so that the according
public key for encryption can be determined and the origin can be
verified.SignatureVerificationException
- in case verifying the signature
for the message failed to to no public key found which
successfully verified the signatureCopyright © 2021. All rights reserved.