- com
- pcbsys
- nirvana
- client
- nCertificateSigner
This class signs nConsumeEvents as they are published to the Realm Server. More...
Public Member Functions | |
Provider | getProvider () |
Return the Provider used to vend the Signature class. More... | |
nCertificateSigner (java.security.cert.X509Certificate cert, java.security.PrivateKey key) throws nIllegalArgumentException, CertificateExpiredException, CertificateNotYetValidException, NoSuchAlgorithmException, InvalidKeyException | |
Constructs a Signer class using the supplied Certificate and private key. More... | |
nCertificateSigner (java.security.cert.X509Certificate cert, java.security.PrivateKey key, String algorithm) throws nIllegalArgumentException, CertificateExpiredException, CertificateNotYetValidException, NoSuchAlgorithmException, InvalidKeyException | |
Constructs a Signer class using the supplied Certificate, private key and will use the algorithm supplied to sign the event. More... | |
nCertificateSigner (KeyStore keystore, String alias, String privKeyPassword) throws nIllegalArgumentException, CertificateExpiredException, CertificateNotYetValidException, NoSuchAlgorithmException, InvalidKeyException, KeyStoreException, UnrecoverableKeyException | |
Constructs a signer class using the keystore and alias. More... | |
nCertificateSigner (KeyStore keystore, String alias, String privKeyPassword, String algorithm) throws nIllegalArgumentException, CertificateExpiredException, CertificateNotYetValidException, NoSuchAlgorithmException, InvalidKeyException, KeyStoreException, UnrecoverableKeyException | |
Constructs a signer class using the keystore, alias and an algorithm The certificate specified by the alias is then used as well as the private key for the certificate. More... | |
nCertificateSigner (String keystoreName, String keyStorePasswd, String alias, String privKeyPassword) throws nIllegalArgumentException, CertificateExpiredException, CertificateNotYetValidException, NoSuchAlgorithmException, InvalidKeyException, KeyStoreException, FileNotFoundException, IOException, CertificateException, UnrecoverableKeyException | |
Constructs a signature class use a keystore specified by the filename. More... | |
nCertificateSigner (String keystoreName, String keyStorePasswd, String alias, String privKeyPassword, String algorithm) throws nIllegalArgumentException, CertificateExpiredException, CertificateNotYetValidException, NoSuchAlgorithmException, InvalidKeyException, KeyStoreException, FileNotFoundException, CertificateException, IOException, UnrecoverableKeyException | |
Constructs a signature class use a keystore specified by the filename, and the algorithm specified. More... | |
byte[] | sign () throws Exception |
Creates a signature from the data passed in using the update method. More... | |
void | update (byte[] data) throws Exception |
Adds the data to the signature. More... | |
Static Public Member Functions | |
static String | getDefaultAlgorithm () |
Get the default algorithm that will be used if no algorithm is supplied. More... | |
This class signs nConsumeEvents as they are published to the Realm Server.
It requires the Java Crypto API (JCE) be installed so that the required algorithm can be found.
com.pcbsys.nirvana.client.nCertificateSigner.nCertificateSigner | ( | java.security.cert.X509Certificate | cert, |
java.security.PrivateKey | key | ||
) | throws nIllegalArgumentException, CertificateExpiredException, CertificateNotYetValidException, NoSuchAlgorithmException, InvalidKeyException |
Constructs a Signer class using the supplied Certificate and private key.
cert | X509Certificate that will be used to sign |
key | The private key for the certificate |
nIllegalArgumentException | If any arguments are invalid |
CertificateExpiredException | If the supplied certificate has expired |
CertificateNotYetValidException | If the supplied certificate is yet to become valid |
NoSuchAlgorithmException | Unable to locate the specific algorithm |
InvalidKeyException | If unable to access the private / public key supplied |
com.pcbsys.nirvana.client.nCertificateSigner.nCertificateSigner | ( | java.security.cert.X509Certificate | cert, |
java.security.PrivateKey | key, | ||
String | algorithm | ||
) | throws nIllegalArgumentException, CertificateExpiredException, CertificateNotYetValidException, NoSuchAlgorithmException, InvalidKeyException |
Constructs a Signer class using the supplied Certificate, private key and will use the algorithm supplied to sign the event.
cert | X509Certificate that will be used to sign |
key | The private key for the certificate |
algorithm | Algorithm to use |
nIllegalArgumentException | If any arguments are invalid |
CertificateExpiredException | If the supplied certificate has expired |
CertificateNotYetValidException | If the supplied certificate is yet to become valid |
NoSuchAlgorithmException | Unable to locate the specific algorithm |
InvalidKeyException | If unable to access the private / public key supplied |
com.pcbsys.nirvana.client.nCertificateSigner.nCertificateSigner | ( | KeyStore | keystore, |
String | alias, | ||
String | privKeyPassword | ||
) | throws nIllegalArgumentException, CertificateExpiredException, CertificateNotYetValidException, NoSuchAlgorithmException, InvalidKeyException, KeyStoreException, UnrecoverableKeyException |
Constructs a signer class using the keystore and alias.
The certificate specified by the alias is then used as well as the private key for the certificate.
keystore | Java keystore containing the certificate to use |
alias | String name of the certificate |
privKeyPassword | Password/phrase to use to gain access to the private key |
nIllegalArgumentException | If any arguments are invalid |
CertificateExpiredException | If the supplied certificate has expired |
CertificateNotYetValidException | If the supplied certificate is yet to become valid |
NoSuchAlgorithmException | Unable to locate the specific algorithm |
InvalidKeyException | If unable to access the private / public key supplied |
KeyStoreException | The keystore supplied is invalid |
UnrecoverableKeyException | Unable to recover from a key error |
com.pcbsys.nirvana.client.nCertificateSigner.nCertificateSigner | ( | KeyStore | keystore, |
String | alias, | ||
String | privKeyPassword, | ||
String | algorithm | ||
) | throws nIllegalArgumentException, CertificateExpiredException, CertificateNotYetValidException, NoSuchAlgorithmException, InvalidKeyException, KeyStoreException, UnrecoverableKeyException |
Constructs a signer class using the keystore, alias and an algorithm The certificate specified by the alias is then used as well as the private key for the certificate.
keystore | Java keystore containing the certificate to use |
alias | String name of the certificate |
privKeyPassword | Password/phrase to use to gain access to the private key |
algorithm | Algorithm to use |
nIllegalArgumentException | If any arguments are invalid |
CertificateExpiredException | If the supplied certificate has expired |
CertificateNotYetValidException | If the supplied certificate is yet to become valid |
NoSuchAlgorithmException | Unable to locate the specific algorithm |
InvalidKeyException | If unable to access the private / public key supplied |
KeyStoreException | The keystore supplied is invalid |
UnrecoverableKeyException | Unable to recover from a key error |
com.pcbsys.nirvana.client.nCertificateSigner.nCertificateSigner | ( | String | keystoreName, |
String | keyStorePasswd, | ||
String | alias, | ||
String | privKeyPassword | ||
) | throws nIllegalArgumentException, CertificateExpiredException, CertificateNotYetValidException, NoSuchAlgorithmException, InvalidKeyException, KeyStoreException, FileNotFoundException, IOException, CertificateException, UnrecoverableKeyException |
Constructs a signature class use a keystore specified by the filename.
This constructor will load the keystore from disk and then load the certificate from the keystore to use. The keystore must exist.
keystoreName | File name of the keystore to use |
keyStorePasswd | Password/phrase used to access the keystore |
alias | The name of the certificate within the keystore to use |
privKeyPassword | The password/phrase used to access the private key of the certificate |
nIllegalArgumentException | If any arguments are invalid |
CertificateExpiredException | If the supplied certificate has expired |
CertificateNotYetValidException | If the supplied certificate is yet to become valid |
NoSuchAlgorithmException | Unable to locate the specific algorithm |
InvalidKeyException | If unable to access the private / public key supplied |
KeyStoreException | The keystore supplied is invalid |
UnrecoverableKeyException | Unable to recover from a key error |
FileNotFoundException | KeyStore does not exist |
IOException | Unable to load the keystore supplied |
CertificateException | if the certificate found has exceptions |
com.pcbsys.nirvana.client.nCertificateSigner.nCertificateSigner | ( | String | keystoreName, |
String | keyStorePasswd, | ||
String | alias, | ||
String | privKeyPassword, | ||
String | algorithm | ||
) | throws nIllegalArgumentException, CertificateExpiredException, CertificateNotYetValidException, NoSuchAlgorithmException, InvalidKeyException, KeyStoreException, FileNotFoundException, CertificateException, IOException, UnrecoverableKeyException |
Constructs a signature class use a keystore specified by the filename, and the algorithm specified.
This constructor will load the keystore from disk and then load the certificate from the keystore to use. The keystore must exist.
keystoreName | File name of the keystore to use |
keyStorePasswd | Password/phrase used to access the keystore |
alias | The name of the certificate within the keystore to use |
privKeyPassword | The password/phrase used to access the private key of the certificate |
algorithm | Algorithm to use |
nIllegalArgumentException | If any arguments are invalid |
CertificateExpiredException | If the supplied certificate has expired |
CertificateNotYetValidException | If the supplied certificate is yet to become valid |
NoSuchAlgorithmException | Unable to locate the specific algorithm |
InvalidKeyException | If unable to access the private / public key supplied |
KeyStoreException | The keystore supplied is invalid |
UnrecoverableKeyException | Unable to recover from a key error |
FileNotFoundException | KeyStore does not exist |
CertificateException | if the certificate found has exceptions |
IOException | Unable to load the keystore supplied |
|
static |
Get the default algorithm that will be used if no algorithm is supplied.
Currently this is SHA1 with RSA.
Provider com.pcbsys.nirvana.client.nCertificateSigner.getProvider | ( | ) |
Return the Provider used to vend the Signature class.
Implements com.pcbsys.nirvana.client.nMessageSigner.
byte [] com.pcbsys.nirvana.client.nCertificateSigner.sign | ( | ) | throws Exception |
Creates a signature from the data passed in using the update method.
Exception | If unable to produce a signature |
Implements com.pcbsys.nirvana.client.nMessageSigner.
void com.pcbsys.nirvana.client.nCertificateSigner.update | ( | byte[] | data | ) | throws Exception |
Adds the data to the signature.
data | Data to add to the signature |
Exception | if unable to process the data |
Implements com.pcbsys.nirvana.client.nMessageSigner.