Package org.xipki.cmp.client.internal
Class CmpClientImpl
- java.lang.Object
-
- org.xipki.cmp.client.internal.CmpClientImpl
-
-
Constructor Summary
Constructors Constructor Description CmpClientImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.xipki.security.X509CertcaCert(String caName, org.xipki.util.ReqRespDebug debug)Returns the CA certificate.List<org.xipki.security.X509Cert>caCerts(String caName, org.xipki.util.ReqRespDebug debug)Returns the CA certificate chain.voidclose()org.bouncycastle.cert.X509CRLHolderdownloadCrl(String caName, org.xipki.util.ReqRespDebug debug)Downloads the current CRL.EnrollCertResultenrollCert(String caName, Requestor requestor, org.bouncycastle.asn1.pkcs.CertificationRequest csr, String profile, Instant notBefore, Instant notAfter, org.xipki.util.ReqRespDebug debug)Enrolls a certificate.EnrollCertResultenrollCerts(String caName, Requestor requestor, EnrollCertRequest request, org.xipki.util.ReqRespDebug debug)Enrolls a set of certificates.List<org.xipki.security.X509Cert>getDhPopPeerCertificates()Returns the certificates held by CA for the DH KeyAgreement.voidinit()CertIdOrErrorrevokeCert(String caName, Requestor requestor, org.xipki.security.X509Cert issuerCert, BigInteger serial, int reason, Instant invalidityDate, org.xipki.util.ReqRespDebug debug)Revokes a certificate.CertIdOrErrorrevokeCert(String caName, Requestor requestor, org.xipki.security.X509Cert issuerCert, org.xipki.security.X509Cert cert, int reason, Instant invalidityDate, org.xipki.util.ReqRespDebug debug)Revokes a certificate.Map<String,CertIdOrError>revokeCerts(String caName, Requestor requestor, RevokeCertRequest request, org.xipki.util.ReqRespDebug debug)Revoke a set of certificates.voidsetConfFile(String confFile)voidsetSecurityFactory(org.xipki.security.SecurityFactory securityFactory)CertIdOrErrorunsuspendCert(String caName, Requestor requestor, org.xipki.security.X509Cert issuerCert, BigInteger serial, org.xipki.util.ReqRespDebug debug)Unsuspends a certificate.CertIdOrErrorunsuspendCert(String caName, Requestor requestor, org.xipki.security.X509Cert issuerCert, org.xipki.security.X509Cert cert, org.xipki.util.ReqRespDebug debug)Unsuspends certificates.Map<String,CertIdOrError>unsuspendCerts(String caName, Requestor requestor, UnrevokeCertRequest request, org.xipki.util.ReqRespDebug debug)Unsuspends certificates.
-
-
-
Method Detail
-
setSecurityFactory
public void setSecurityFactory(org.xipki.security.SecurityFactory securityFactory)
-
setConfFile
public void setConfFile(String confFile)
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
enrollCert
public EnrollCertResult enrollCert(String caName, Requestor requestor, org.bouncycastle.asn1.pkcs.CertificationRequest csr, String profile, Instant notBefore, Instant notAfter, org.xipki.util.ReqRespDebug debug) throws CmpClientException, PkiErrorException
Description copied from interface:CmpClientEnrolls a certificate.- Specified by:
enrollCertin interfaceCmpClient- Parameters:
caName- CA name. Must not benull.csr- CSR. Must not benull.profile- Certificate profile name. Must not benull.notBefore- NotBefore. Could benull.notAfter- NotAfter. Could benull.debug- Request/response debug control. Could benull.- Returns:
- the enrolling result.
- Throws:
CmpClientException- if client error occurs.PkiErrorException- if the response returns none-success status.
-
enrollCerts
public EnrollCertResult enrollCerts(String caName, Requestor requestor, EnrollCertRequest request, org.xipki.util.ReqRespDebug debug) throws CmpClientException, PkiErrorException
Description copied from interface:CmpClientEnrolls a set of certificates.- Specified by:
enrollCertsin interfaceCmpClient- Parameters:
caName- CA name. Must not benull.request- Request. Must not benull.debug- Request/response debug control. Could benull.- Returns:
- the enrolling result.
- Throws:
CmpClientException- if client error occurs.PkiErrorException- if the response returns none-success status.
-
revokeCert
public CertIdOrError revokeCert(String caName, Requestor requestor, org.xipki.security.X509Cert issuerCert, org.xipki.security.X509Cert cert, int reason, Instant invalidityDate, org.xipki.util.ReqRespDebug debug) throws CmpClientException, PkiErrorException
Description copied from interface:CmpClientRevokes a certificate.- Specified by:
revokeCertin interfaceCmpClient- Parameters:
caName- CA name. Must not benull.issuerCert- Issuer's certificate. Must not benull.cert- Target certificate. Must not benull.reason- Revocation reason.invalidityDate- Invalidity time. Could benull.debug- Request/response debug control. Could benull.- Returns:
- the revocation result.
- Throws:
CmpClientException- if client error occurs.PkiErrorException- if the response returns none-success status.
-
revokeCert
public CertIdOrError revokeCert(String caName, Requestor requestor, org.xipki.security.X509Cert issuerCert, BigInteger serial, int reason, Instant invalidityDate, org.xipki.util.ReqRespDebug debug) throws CmpClientException, PkiErrorException
Description copied from interface:CmpClientRevokes a certificate.- Specified by:
revokeCertin interfaceCmpClient- Parameters:
caName- CA name. Must not benull.issuerCert- Issuer's certificate. Must not benull.serial- Serial number of the target certificate. Must not benull.reason- Revocation reason.invalidityDate- Invalidity time. Could benull.debug- Request/response debug control. Could benull.- Returns:
- the revocation result.
- Throws:
CmpClientException- if client error occurs.PkiErrorException- if the response returns none-success status.
-
revokeCerts
public Map<String,CertIdOrError> revokeCerts(String caName, Requestor requestor, RevokeCertRequest request, org.xipki.util.ReqRespDebug debug) throws CmpClientException, PkiErrorException
Description copied from interface:CmpClientRevoke a set of certificates.- Specified by:
revokeCertsin interfaceCmpClientrequest- Request. Must not benull.debug- Request/response debug control. Could benull.- Returns:
- the revocation result.
- Throws:
CmpClientException- if client error occurs.PkiErrorException- if the response returns none-success status.
-
downloadCrl
public org.bouncycastle.cert.X509CRLHolder downloadCrl(String caName, org.xipki.util.ReqRespDebug debug) throws CmpClientException, PkiErrorException
Description copied from interface:CmpClientDownloads the current CRL.- Specified by:
downloadCrlin interfaceCmpClient- Parameters:
caName- CA name. Must not benull.debug- Request/response debug control. Could benull.- Returns:
- the X509 CRL. Must not be
null. - Throws:
CmpClientException- if client error occurs.PkiErrorException- if the response returns none-success status.
-
unsuspendCert
public CertIdOrError unsuspendCert(String caName, Requestor requestor, org.xipki.security.X509Cert issuerCert, org.xipki.security.X509Cert cert, org.xipki.util.ReqRespDebug debug) throws CmpClientException, PkiErrorException
Description copied from interface:CmpClientUnsuspends certificates.- Specified by:
unsuspendCertin interfaceCmpClient- Parameters:
caName- CA name. Must not benull.issuerCert- Issuer's certificate. Must not benull.cert- Target certificate. Must not benull.debug- Request/response debug control. Could benull.- Returns:
- result of the unrevocation.
- Throws:
CmpClientException- if client error occurs.PkiErrorException- if the response returns none-success status.
-
unsuspendCert
public CertIdOrError unsuspendCert(String caName, Requestor requestor, org.xipki.security.X509Cert issuerCert, BigInteger serial, org.xipki.util.ReqRespDebug debug) throws CmpClientException, PkiErrorException
Description copied from interface:CmpClientUnsuspends a certificate.- Specified by:
unsuspendCertin interfaceCmpClient- Parameters:
caName- CA name. Must not benull.issuerCert- Issuer's certificate. Must not benull.serial- Serial number of the certificate. Must not benull.debug- Request/response debug control. Could benull.- Returns:
- result of action.
- Throws:
CmpClientException- if client error occurs.PkiErrorException- if the response returns none-success status.
-
unsuspendCerts
public Map<String,CertIdOrError> unsuspendCerts(String caName, Requestor requestor, UnrevokeCertRequest request, org.xipki.util.ReqRespDebug debug) throws CmpClientException, PkiErrorException
Description copied from interface:CmpClientUnsuspends certificates.- Specified by:
unsuspendCertsin interfaceCmpClient- Parameters:
caName- CA name. Must not benull.request- Request. Must not benull.debug- Request/response debug control. Could benull.- Returns:
- result of the unrevocation.
- Throws:
CmpClientException- if client error occurs.PkiErrorException- if the response returns none-success status.
-
caCert
public org.xipki.security.X509Cert caCert(String caName, org.xipki.util.ReqRespDebug debug) throws CmpClientException, PkiErrorException
Description copied from interface:CmpClientReturns the CA certificate.- Specified by:
caCertin interfaceCmpClient- Parameters:
caName- the CA name- Returns:
- the CA certificate
- Throws:
CmpClientException- if client error occurs.PkiErrorException
-
caCerts
public List<org.xipki.security.X509Cert> caCerts(String caName, org.xipki.util.ReqRespDebug debug) throws CmpClientException, PkiErrorException
Description copied from interface:CmpClientReturns the CA certificate chain.- Specified by:
caCertsin interfaceCmpClient- Parameters:
caName- the CA name- Returns:
- the CA certificate
- Throws:
CmpClientException- if client error occurs.PkiErrorException
-
getDhPopPeerCertificates
public List<org.xipki.security.X509Cert> getDhPopPeerCertificates()
Description copied from interface:CmpClientReturns the certificates held by CA for the DH KeyAgreement.- Specified by:
getDhPopPeerCertificatesin interfaceCmpClient- Returns:
- the certificates held by CA for the DH KeyAgreement,
-
-