public class CertificateManager extends Object
| Modifier and Type | Method and Description |
|---|---|
Signature |
extractSignature(Certificate cert) |
Certificate[] |
getCerts() |
protected Certificate[] |
getCertsFromKeyStore() |
protected String |
getEntryPassword()
Get password for key store entry from password request listener
|
protected PrivateKey |
getPrivateKey(Certificate cert)
Get private key from certificate
|
boolean |
hasNoCertificates() |
void |
load()
Load certificates from key store
|
void |
setKeyStoreRequestListener(KeyStoreRequestListener keyStoreRequestListener) |
void |
setPasswordRequestListener(KeyStoreEntryPasswordRequestListener passwordRequestListener)
Set password request listener
|
byte[] |
sign(Certificate cert,
byte[] challenge) |
boolean |
verify(Certificate cert,
byte[] original,
byte[] signed) |
public void setPasswordRequestListener(KeyStoreEntryPasswordRequestListener passwordRequestListener)
passwordRequestListener - new password request listenerpublic void setKeyStoreRequestListener(KeyStoreRequestListener keyStoreRequestListener)
public Certificate[] getCerts()
public boolean hasNoCertificates()
public byte[] sign(Certificate cert, byte[] challenge) throws SignatureImpossibleException
SignatureImpossibleExceptionpublic Signature extractSignature(Certificate cert) throws SignatureImpossibleException
SignatureImpossibleExceptionpublic boolean verify(Certificate cert, byte[] original, byte[] signed) throws SignatureVerificationImpossibleException
protected PrivateKey getPrivateKey(Certificate cert) throws KeyStoreException, CertificateNotInKeyStoreException, CertificateHasNoPrivateKeyException, NoSuchAlgorithmException, UnrecoverableEntryException
cert - certificateKeyStoreException - on key store errorCertificateNotInKeyStoreException - when certificate not in key storeCertificateHasNoPrivateKeyException - when certificate has no private keyNoSuchAlgorithmException - when a particular cryptographic algorithm is requested but is not available in the environment.UnrecoverableEntryException - if an entry in the keystore cannot be recoveredprotected String getEntryPassword()
public void load()
throws KeyStoreLoaderException
KeyStoreLoaderException - on loader errorprotected Certificate[] getCertsFromKeyStore() throws KeyStoreException, UnrecoverableEntryException, NoSuchAlgorithmException
Copyright © 2018. All rights reserved.