- com
- pcbsys
- nirvana
- client
- nCertificateValidator
This class validates signatures signed by the nCertificateSigner class. More...
Public Member Functions | |
Object | check (byte[] original) throws Exception |
Performs the validation with the original signature against the signature created with the update methods. More... | |
java.security.cert.Certificate[] | getLoadedCertificates () |
Returns an array of certificates that this object is using to valdiate the signature. More... | |
Provider | getProvider () |
Return the Provider used to vend the Signature class. More... | |
nCertificateValidator (java.security.cert.X509Certificate[] certificates) throws nIllegalArgumentException, NoSuchAlgorithmException, InvalidKeyException | |
Constructs the validator class with an array of certificates to use. More... | |
nCertificateValidator (java.security.cert.X509Certificate[] certificates, String algorithm) throws nIllegalArgumentException, NoSuchAlgorithmException, InvalidKeyException | |
Constructs the validator class with an array of certificates to use. More... | |
nCertificateValidator (KeyStore keystore) throws nIllegalArgumentException, NoSuchAlgorithmException, InvalidKeyException, KeyStoreException | |
Constructs the Validator object and loads all of the certificate found within the supplied keystore. More... | |
nCertificateValidator (KeyStore keystore, String algorithm) throws nIllegalArgumentException, NoSuchAlgorithmException, InvalidKeyException, KeyStoreException | |
Constructs the Validator object and loads all of the certificate found within the supplied keystore. More... | |
nCertificateValidator (String keystoreName, String keyStorePasswd) throws nIllegalArgumentException, KeyStoreException, FileNotFoundException, CertificateException, NoSuchAlgorithmException, IOException, NoSuchAlgorithmException, InvalidKeyException | |
Constructs a Validator object by loading the specified keystore from disk and then loading all the certificates within the keystore to be used to validate the nConsumeEvent signature. More... | |
nCertificateValidator (String keystoreName, String keyStorePasswd, String algorithm) throws nIllegalArgumentException, KeyStoreException, FileNotFoundException, CertificateException, NoSuchAlgorithmException, IOException, NoSuchAlgorithmException, InvalidKeyException | |
Constructs a Validator object by loading the specified keystore from disk and then loading all the certificates within the keystore to be used to validate the nConsumeEvent signature. More... | |
void | start (byte[] sig) |
Locates the certificate that was used to create the signature. More... | |
void | stop () |
Resets this certificate that this class will use for validation. | |
void | update (byte[] data) throws Exception |
Updates the signature with the supplied data. More... | |
Static Public Member Functions | |
static String | getDefaultAlgorithm () |
Get the default algorithm that will be used if no algorithm is supplied. More... | |
This class validates signatures signed by the nCertificateSigner class.
It is constructed with at least one certificate or a list of certificates that it will then use to validate the nConsumeEvents which will be passed to the nSignedEventListener interface. The Object in the go method contains the X509 certificate of the signer. If the remote certificate can not be found then the error method is called with the signature byte[] as part of the callback
com.pcbsys.nirvana.client.nCertificateValidator.nCertificateValidator | ( | java.security.cert.X509Certificate[] | certificates | ) | throws nIllegalArgumentException, NoSuchAlgorithmException, InvalidKeyException |
Constructs the validator class with an array of certificates to use.
certificates | Array of X509Certificates to use |
nIllegalArgumentException | If any parameters are invalid |
NoSuchAlgorithmException | Algorithm can not be found |
InvalidKeyException | Unable to access the public keys in the certificates supplied |
com.pcbsys.nirvana.client.nCertificateValidator.nCertificateValidator | ( | java.security.cert.X509Certificate[] | certificates, |
String | algorithm | ||
) | throws nIllegalArgumentException, NoSuchAlgorithmException, InvalidKeyException |
Constructs the validator class with an array of certificates to use.
certificates | Array of X509Certificates to use |
algorithm | Signature algorithm to use |
nIllegalArgumentException | If any parameters are invalid |
NoSuchAlgorithmException | Algorithm can not be found |
InvalidKeyException | Unable to access the public keys in the certificates supplied |
com.pcbsys.nirvana.client.nCertificateValidator.nCertificateValidator | ( | KeyStore | keystore | ) | throws nIllegalArgumentException, NoSuchAlgorithmException, InvalidKeyException, KeyStoreException |
Constructs the Validator object and loads all of the certificate found within the supplied keystore.
keystore | Keystore to use |
nIllegalArgumentException | If any parameters are invalid |
NoSuchAlgorithmException | Algorithm can not be found |
InvalidKeyException | Unable to access the public keys in the certificates supplied |
KeyStoreException | The keystore supplied is invalid |
com.pcbsys.nirvana.client.nCertificateValidator.nCertificateValidator | ( | KeyStore | keystore, |
String | algorithm | ||
) | throws nIllegalArgumentException, NoSuchAlgorithmException, InvalidKeyException, KeyStoreException |
Constructs the Validator object and loads all of the certificate found within the supplied keystore.
keystore | Keystore to use |
algorithm | Algorithm to use for the Signature class |
nIllegalArgumentException | If any parameters are invalid |
NoSuchAlgorithmException | Algorithm can not be found |
InvalidKeyException | Unable to access the public keys in the certificates supplied |
KeyStoreException | The keystore supplied is invalid |
com.pcbsys.nirvana.client.nCertificateValidator.nCertificateValidator | ( | String | keystoreName, |
String | keyStorePasswd | ||
) | throws nIllegalArgumentException, KeyStoreException, FileNotFoundException, CertificateException, NoSuchAlgorithmException, IOException, NoSuchAlgorithmException, InvalidKeyException |
Constructs a Validator object by loading the specified keystore from disk and then loading all the certificates within the keystore to be used to validate the nConsumeEvent signature.
keystoreName | Filename of the keystore to use |
keyStorePasswd | Password/phrase to use to gain access to the keystore |
nIllegalArgumentException | If any parameters are invalid |
KeyStoreException | if KeyStore is in error |
FileNotFoundException | KeyStore not found |
CertificateException | Invalid Certificate |
NoSuchAlgorithmException | Algorithm can not be found |
IOException | KeyStore failed during load |
NoSuchAlgorithmException | The algorithm specified can not be located |
InvalidKeyException | Unable to access the public keys in the certificates supplied |
com.pcbsys.nirvana.client.nCertificateValidator.nCertificateValidator | ( | String | keystoreName, |
String | keyStorePasswd, | ||
String | algorithm | ||
) | throws nIllegalArgumentException, KeyStoreException, FileNotFoundException, CertificateException, NoSuchAlgorithmException, IOException, NoSuchAlgorithmException, InvalidKeyException |
Constructs a Validator object by loading the specified keystore from disk and then loading all the certificates within the keystore to be used to validate the nConsumeEvent signature.
keystoreName | Filename of the keystore to use |
keyStorePasswd | Password/phrase to use to gain access to the keystore |
algorithm | Algorithm to use for the Signature class |
nIllegalArgumentException | If any parameters are invalid |
KeyStoreException | if KeyStore is in error |
FileNotFoundException | KeyStore not found |
CertificateException | Invalid Certificate |
NoSuchAlgorithmException | Algorithm can not be found |
IOException | KeyStore failed during load |
NoSuchAlgorithmException | The algorithm specified can not be located |
InvalidKeyException | Unable to access the public keys in the certificates supplied |
Object com.pcbsys.nirvana.client.nCertificateValidator.check | ( | byte[] | original | ) | throws Exception |
Performs the validation with the original signature against the signature created with the update methods.
Will throw an exception if the signatures do not match
original | Original signature |
Exception | If the signatures do not match or unable to locate the signing certificate |
Implements com.pcbsys.nirvana.client.nMessageValidator.
|
static |
Get the default algorithm that will be used if no algorithm is supplied.
Currently this is SHA1 with RSA.
java.security.cert.Certificate [] com.pcbsys.nirvana.client.nCertificateValidator.getLoadedCertificates | ( | ) |
Returns an array of certificates that this object is using to valdiate the signature.
Provider com.pcbsys.nirvana.client.nCertificateValidator.getProvider | ( | ) |
Return the Provider used to vend the Signature class.
Implements com.pcbsys.nirvana.client.nMessageValidator.
void com.pcbsys.nirvana.client.nCertificateValidator.start | ( | byte[] | sig | ) |
Locates the certificate that was used to create the signature.
Then resets this object to use this certificate
sig | Original signing object |
Implements com.pcbsys.nirvana.client.nMessageValidator.
void com.pcbsys.nirvana.client.nCertificateValidator.update | ( | byte[] | data | ) | throws Exception |
Updates the signature with the supplied data.
data | data to add |
Exception | Depending on the implementation of the signature class |
Implements com.pcbsys.nirvana.client.nMessageValidator.