com.pcbsys.nirvana.client.nCertificateSigner Class Reference

This class signs nConsumeEvents as they are published to the Realm Server. More...

Inheritance diagram for com.pcbsys.nirvana.client.nCertificateSigner:

com.pcbsys.nirvana.client.nMessageSigner

Public Member Functions

Provider getProvider ()
 Return the Provider used to vend the Signature class.
 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.
 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.
 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.
 nCertificateSigner (KeyStore keystore, String alias, String privKeyPassword) throws nIllegalArgumentException, CertificateExpiredException, CertificateNotYetValidException, NoSuchAlgorithmException, InvalidKeyException, KeyStoreException, UnrecoverableKeyException
 Constructs a signer class using the keystore and alias.
 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.
 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.
byte[] sign () throws Exception
 Creates a signature from the data passed in using the update method.
void update (byte[] data) throws Exception
 Adds the data to the signature.

Static Public Member Functions

static String getDefaultAlgorithm ()
 Get the default algorithm that will be used if no algorithm is supplied.

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
cert X509Certificate that will be used to sign
key The private key for the certificate
Exceptions:
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.

Parameters:
cert X509Certificate that will be used to sign
key The private key for the certificate
algorithm Algorithm to use
Exceptions:
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.

Parameters:
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
Exceptions:
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.

Parameters:
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
Exceptions:
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.

Parameters:
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
Exceptions:
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.

Parameters:
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
Exceptions:
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


Member Function Documentation

static String com.pcbsys.nirvana.client.nCertificateSigner.getDefaultAlgorithm (  )  [static]

Get the default algorithm that will be used if no algorithm is supplied.

Currently this is SHA1 with RSA.

Returns:
The Algorithm name that will be used by default

Provider com.pcbsys.nirvana.client.nCertificateSigner.getProvider (  ) 

Return the Provider used to vend the Signature class.

Returns:
a java.security.Provider 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.

Returns:
a byte[] representing the signature
Exceptions:
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.

Parameters:
data Data to add to the signature
Exceptions:
Exception if unable to process the data

Implements com.pcbsys.nirvana.client.nMessageSigner.

Share this page with others:
Tell Your Tweets Facebook It! Add to Delicious Reddit! Digg It! Stumble Upon Add to Your Faves Mixx it
Follow Us:
Keep up with my-Channels on Twitter Become a fan on Facebook LinkedIn Profile Recent Highlights RSS Feed