Package org.netxms.certificate.manager
Class CertificateManager
java.lang.Object
org.netxms.certificate.manager.CertificateManager
- 
Method SummaryModifier and TypeMethodDescriptionextractSignature(Certificate cert) getCerts()protected Certificate[]protected StringGet password for key store entry from password request listenerprotected PrivateKeygetPrivateKey(Certificate cert) Get private key from certificatebooleanvoidload()Load certificates from key storevoidsetKeyStoreRequestListener(KeyStoreRequestListener keyStoreRequestListener) voidsetPasswordRequestListener(KeyStoreEntryPasswordRequestListener passwordRequestListener) Set password request listenerbyte[]sign(Certificate cert, byte[] challenge) booleanverify(Certificate cert, byte[] original, byte[] signed) 
- 
Method Details- 
setPasswordRequestListenerpublic void setPasswordRequestListener(KeyStoreEntryPasswordRequestListener passwordRequestListener) Set password request listener- Parameters:
- passwordRequestListener- new password request listener
 
- 
setKeyStoreRequestListener
- 
getCerts
- 
hasNoCertificatespublic boolean hasNoCertificates()
- 
sign- Throws:
- SignatureImpossibleException
 
- 
extractSignature- Throws:
- SignatureImpossibleException
 
- 
verifypublic boolean verify(Certificate cert, byte[] original, byte[] signed) throws SignatureVerificationImpossibleException 
- 
getPrivateKeyprotected PrivateKey getPrivateKey(Certificate cert) throws KeyStoreException, CertificateNotInKeyStoreException, CertificateHasNoPrivateKeyException, NoSuchAlgorithmException, UnrecoverableEntryException Get private key from certificate- Parameters:
- cert- certificate
- Returns:
- private key for given certificate
- Throws:
- KeyStoreException- on key store error
- CertificateNotInKeyStoreException- when certificate not in key store
- CertificateHasNoPrivateKeyException- when certificate has no private key
- NoSuchAlgorithmException- when a particular cryptographic algorithm is requested but is not available in the environment.
- UnrecoverableEntryException- if an entry in the keystore cannot be recovered
 
- 
getEntryPasswordGet password for key store entry from password request listener- Returns:
- password
 
- 
loadLoad certificates from key store- Throws:
- KeyStoreLoaderException- on loader error
 
- 
getCertsFromKeyStoreprotected Certificate[] getCertsFromKeyStore() throws KeyStoreException, UnrecoverableEntryException, NoSuchAlgorithmException
 
-