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(java.lang.String caName, org.xipki.util.ReqRespDebug debug)Returns the CA certificate.java.util.List<org.xipki.security.X509Cert>caCerts(java.lang.String caName, org.xipki.util.ReqRespDebug debug)Returns the CA certificate chain.voidclose()org.bouncycastle.cert.X509CRLHolderdownloadCrl(java.lang.String caName, org.xipki.util.ReqRespDebug debug)Downloads the current CRL.EnrollCertResultenrollCert(java.lang.String caName, Requestor requestor, org.bouncycastle.asn1.pkcs.CertificationRequest csr, java.lang.String profile, java.time.Instant notBefore, java.time.Instant notAfter, org.xipki.util.ReqRespDebug debug)Enrolls a certificate.EnrollCertResultenrollCerts(java.lang.String caName, Requestor requestor, EnrollCertRequest request, org.xipki.util.ReqRespDebug debug)Enrolls a set of certificates.java.util.List<org.xipki.security.X509Cert>getDhPopPeerCertificates()Returns the certificates held by CA for the DH KeyAgreement.voidinit()CertIdOrErrorrevokeCert(java.lang.String caName, Requestor requestor, org.xipki.security.X509Cert issuerCert, java.math.BigInteger serial, int reason, java.time.Instant invalidityDate, org.xipki.util.ReqRespDebug debug)Revokes a certificate.CertIdOrErrorrevokeCert(java.lang.String caName, Requestor requestor, org.xipki.security.X509Cert issuerCert, org.xipki.security.X509Cert cert, int reason, java.time.Instant invalidityDate, org.xipki.util.ReqRespDebug debug)Revokes a certificate.java.util.Map<java.lang.String,CertIdOrError>revokeCerts(java.lang.String caName, Requestor requestor, RevokeCertRequest request, org.xipki.util.ReqRespDebug debug)Revoke a set of certificates.voidsetConfFile(java.lang.String confFile)voidsetSecurityFactory(org.xipki.security.SecurityFactory securityFactory)CertIdOrErrorunsuspendCert(java.lang.String caName, Requestor requestor, org.xipki.security.X509Cert issuerCert, java.math.BigInteger serial, org.xipki.util.ReqRespDebug debug)Unsuspends a certificate.CertIdOrErrorunsuspendCert(java.lang.String caName, Requestor requestor, org.xipki.security.X509Cert issuerCert, org.xipki.security.X509Cert cert, org.xipki.util.ReqRespDebug debug)Unsuspends certificates.java.util.Map<java.lang.String,CertIdOrError>unsuspendCerts(java.lang.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(java.lang.String confFile)
-
init
public void init() throws java.lang.Exception- Throws:
java.lang.Exception
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
enrollCert
public EnrollCertResult enrollCert(java.lang.String caName, Requestor requestor, org.bouncycastle.asn1.pkcs.CertificationRequest csr, java.lang.String profile, java.time.Instant notBefore, java.time.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.requestor- Requestor, the actor which requests the operation. 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(java.lang.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.requestor- Requestor, the actor which requests the operation. 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(java.lang.String caName, Requestor requestor, org.xipki.security.X509Cert issuerCert, org.xipki.security.X509Cert cert, int reason, java.time.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.requestor- Requestor, the actor which requests the operation. 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(java.lang.String caName, Requestor requestor, org.xipki.security.X509Cert issuerCert, java.math.BigInteger serial, int reason, java.time.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.requestor- Requestor, the actor which requests the operation. 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 java.util.Map<java.lang.String,CertIdOrError> revokeCerts(java.lang.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 interfaceCmpClient- Parameters:
caName- CA name. Must not benull.requestor- Requestor, the actor which requests the operation. Must not benull.request- 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(java.lang.String caName, org.xipki.util.ReqRespDebug debug) throws CmpClientException, PkiErrorExceptionDescription 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(java.lang.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.requestor- Requestor, the actor which requests the operation. 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(java.lang.String caName, Requestor requestor, org.xipki.security.X509Cert issuerCert, java.math.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.requestor- Requestor, the actor which requests the operation. 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 java.util.Map<java.lang.String,CertIdOrError> unsuspendCerts(java.lang.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.requestor- Requestor, the actor which requests the operation. 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(java.lang.String caName, org.xipki.util.ReqRespDebug debug) throws CmpClientException, PkiErrorExceptionDescription copied from interface:CmpClientReturns the CA certificate.- Specified by:
caCertin interfaceCmpClient- Parameters:
caName- the CA namedebug- Request/response debug control. Could benull.- Returns:
- the CA certificate
- Throws:
CmpClientException- if client error occurs.PkiErrorException- if the response returns none-success status.
-
caCerts
public java.util.List<org.xipki.security.X509Cert> caCerts(java.lang.String caName, org.xipki.util.ReqRespDebug debug) throws CmpClientException, PkiErrorExceptionDescription copied from interface:CmpClientReturns the CA certificate chain.- Specified by:
caCertsin interfaceCmpClient- Parameters:
caName- the CA namedebug- Request/response debug control. Could benull.- Returns:
- the CA certificate
- Throws:
CmpClientException- if client error occurs.PkiErrorException- if the response returns none-success status.
-
getDhPopPeerCertificates
public java.util.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,
-
-