public class CertServiceImpl extends DefaultComponent implements CertService
Modifier and Type | Field and Description |
---|---|
protected X509Certificate |
rootCertificate |
protected RootService |
rootService |
lastModified
Constructor and Description |
---|
CertServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected X509Certificate |
createCertificateFromCSR(org.bouncycastle.jce.PKCS10CertificationRequest csr) |
protected org.bouncycastle.asn1.pkcs.CertificationRequest |
generateCSR(KeyPair keyPair,
UserInfo userInfo) |
protected Date |
getCertEndDate() |
protected X509Certificate |
getCertificate(KeyPair keyPair,
UserInfo userInfo) |
X509Certificate |
getCertificate(KeyStore ks,
String certificateAlias)
Retrieves an existing certificate from a keystore using keystore's certificate alias.
|
String |
getCertificateEmail(X509Certificate certificate)
Extracts the email address from a certificate
|
protected Date |
getCertStartDate() |
KeyPair |
getKeyPair(KeyStore ks,
String keyAlias,
String certAlias,
String keyPassword)
Retrieves existing private and public key from a KeyStore.
|
KeyStore |
getKeyStore(InputStream keystoreIS,
String password)
Retrieves a KeyStore object from a supplied InputStream.
|
X509Certificate |
getRootCertificate()
Retrieves the root certificate.
|
protected RootService |
getRootService() |
KeyStore |
initializeUser(UserInfo userInfo,
String suppliedPassword)
Generates a private key and a public certificate for a user whose X.509 field information was enclosed in a
UserInfo parameter.
|
void |
setRootService(RootService rootService)
Sets up a root service to be used for CA-related services like certificate request signing and certificate
revocation.
|
void |
storeCertificate(KeyStore keystore,
OutputStream os,
String keystorePassword)
Wraps a certificate object into an OutputStream object secured by a keystore password
|
activate, deactivate, getAdapter, getLastModified, registerContribution, registerExtension, setLastModified, setModifiedNow, start, stop, unregisterContribution, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted, getApplicationStartedOrder
protected RootService rootService
protected X509Certificate rootCertificate
public CertServiceImpl()
public void setRootService(RootService rootService)
CertService
setRootService
in interface CertService
protected X509Certificate createCertificateFromCSR(org.bouncycastle.jce.PKCS10CertificationRequest csr) throws CertException
CertException
public X509Certificate getRootCertificate() throws CertException
CertService
getRootCertificate
in interface CertService
CertException
protected Date getCertStartDate()
protected Date getCertEndDate()
public KeyStore initializeUser(UserInfo userInfo, String suppliedPassword) throws CertException
CertService
initializeUser
in interface CertService
CertException
public KeyPair getKeyPair(KeyStore ks, String keyAlias, String certAlias, String keyPassword) throws CertException
CertService
getKeyPair
in interface CertService
CertException
public X509Certificate getCertificate(KeyStore ks, String certificateAlias) throws CertException
CertService
getCertificate
in interface CertService
CertException
protected X509Certificate getCertificate(KeyPair keyPair, UserInfo userInfo) throws CertException
CertException
protected org.bouncycastle.asn1.pkcs.CertificationRequest generateCSR(KeyPair keyPair, UserInfo userInfo) throws CertException
CertException
public KeyStore getKeyStore(InputStream keystoreIS, String password) throws CertException
CertService
getKeyStore
in interface CertService
CertException
public String getCertificateEmail(X509Certificate certificate) throws CertException
CertService
getCertificateEmail
in interface CertService
CertException
public void storeCertificate(KeyStore keystore, OutputStream os, String keystorePassword) throws CertException
CertService
storeCertificate
in interface CertService
CertException
protected RootService getRootService() throws CertException
CertException
Copyright © 2018 Nuxeo. All rights reserved.