Package org.xipki.scep.client
Class Client
- java.lang.Object
-
- org.xipki.scep.client.Client
-
- Direct Known Subclasses:
ScepClient
public abstract class Client extends java.lang.ObjectSCEP client.- Author:
- Lijun Liao (xipki)
-
-
Field Summary
Fields Modifier and Type Field Description protected CaCapscaCapsprotected CaIdentifiercaIdstatic longDEFAULT_SIGNINGTIME_BIASstatic java.lang.StringREQ_CONTENT_TYPE
-
Constructor Summary
Constructors Constructor Description Client(CaIdentifier caId, CaCertValidator caCertValidator)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddestroy()AuthorityCertStoregetAuthorityCertStore()CaCapsgetCaCaps()org.xipki.security.X509CertgetCaCert()CaCertValidatorgetCaCertValidator()CaIdentifiergetCaId()longgetMaxSigningTimeBiasInMs()protected abstract ScepHttpResponsehttpGet(java.lang.String url)Send request via HTTP GET.protected abstract ScepHttpResponsehttpPost(java.lang.String url, java.lang.String requestContentType, byte[] request)Send request via HTTP POST.voidinit()booleanisHttpGetOnly()voidrefresh()EnrolmentResponsescepCertPoll(java.security.PrivateKey identityKey, org.xipki.security.X509Cert identityCert, org.bouncycastle.asn1.pkcs.CertificationRequest csr, org.bouncycastle.asn1.x500.X500Name issuer)EnrolmentResponsescepCertPoll(java.security.PrivateKey identityKey, org.xipki.security.X509Cert identityCert, TransactionId transactionId, org.bouncycastle.asn1.x500.X500Name issuer, org.bouncycastle.asn1.x500.X500Name subject)EnrolmentResponsescepEnrol(org.bouncycastle.asn1.pkcs.CertificationRequest csr, java.security.PrivateKey identityKey, org.xipki.security.X509Cert identityCert)java.util.List<org.xipki.security.X509Cert>scepGetCert(java.security.PrivateKey identityKey, org.xipki.security.X509Cert identityCert, org.bouncycastle.asn1.x500.X500Name issuer, java.math.BigInteger serialNumber)org.bouncycastle.cert.X509CRLHolderscepGetCrl(java.security.PrivateKey identityKey, org.xipki.security.X509Cert identityCert, org.bouncycastle.asn1.x500.X500Name issuer, java.math.BigInteger serialNumber)AuthorityCertStorescepNextCaCert()EnrolmentResponsescepPkcsReq(org.bouncycastle.asn1.pkcs.CertificationRequest csr, java.security.PrivateKey identityKey, org.xipki.security.X509Cert identityCert)EnrolmentResponsescepRenewalReq(org.bouncycastle.asn1.pkcs.CertificationRequest csr, java.security.PrivateKey identityKey, org.xipki.security.X509Cert identityCert)voidsetHttpGetOnly(boolean httpGetOnly)voidsetMaxSigningTimeBiasInMs(long maxSigningTimeBiasInMs)Set the maximal signing time bias in milliseconds.
-
-
-
Field Detail
-
REQ_CONTENT_TYPE
public static final java.lang.String REQ_CONTENT_TYPE
- See Also:
- Constant Field Values
-
DEFAULT_SIGNINGTIME_BIAS
public static final long DEFAULT_SIGNINGTIME_BIAS
- See Also:
- Constant Field Values
-
caId
protected final CaIdentifier caId
-
caCaps
protected CaCaps caCaps
-
-
Constructor Detail
-
Client
public Client(CaIdentifier caId, CaCertValidator caCertValidator)
-
-
Method Detail
-
httpPost
protected abstract ScepHttpResponse httpPost(java.lang.String url, java.lang.String requestContentType, byte[] request) throws ScepClientException
Send request via HTTP POST.- Parameters:
url- SCEP server URL. Must not benull.requestContentType- Content type of the HTTP request. Must not benull.request- HTTP request. Must not benull.- Returns:
- the SCEP response
- Throws:
ScepClientException- If error happens
-
httpGet
protected abstract ScepHttpResponse httpGet(java.lang.String url) throws ScepClientException
Send request via HTTP GET.- Parameters:
url- URL. Must not benull.- Returns:
- the response.
- Throws:
ScepClientException- If error occurs.
-
isHttpGetOnly
public boolean isHttpGetOnly()
-
setHttpGetOnly
public void setHttpGetOnly(boolean httpGetOnly)
-
getMaxSigningTimeBiasInMs
public long getMaxSigningTimeBiasInMs()
-
setMaxSigningTimeBiasInMs
public void setMaxSigningTimeBiasInMs(long maxSigningTimeBiasInMs)
Set the maximal signing time bias in milliseconds.- Parameters:
maxSigningTimeBiasInMs- zero or negative value deactivates the message time check
-
init
public void init() throws ScepClientException- Throws:
ScepClientException
-
refresh
public void refresh() throws ScepClientException- Throws:
ScepClientException
-
getCaCaps
public CaCaps getCaCaps() throws ScepClientException
- Throws:
ScepClientException
-
getCaCert
public org.xipki.security.X509Cert getCaCert()
-
getCaId
public CaIdentifier getCaId() throws ScepClientException
- Throws:
ScepClientException
-
getCaCertValidator
public CaCertValidator getCaCertValidator() throws ScepClientException
- Throws:
ScepClientException
-
getAuthorityCertStore
public AuthorityCertStore getAuthorityCertStore() throws ScepClientException
- Throws:
ScepClientException
-
scepGetCrl
public org.bouncycastle.cert.X509CRLHolder scepGetCrl(java.security.PrivateKey identityKey, org.xipki.security.X509Cert identityCert, org.bouncycastle.asn1.x500.X500Name issuer, java.math.BigInteger serialNumber) throws ScepClientException- Throws:
ScepClientException
-
scepGetCert
public java.util.List<org.xipki.security.X509Cert> scepGetCert(java.security.PrivateKey identityKey, org.xipki.security.X509Cert identityCert, org.bouncycastle.asn1.x500.X500Name issuer, java.math.BigInteger serialNumber) throws ScepClientException- Throws:
ScepClientException
-
scepCertPoll
public EnrolmentResponse scepCertPoll(java.security.PrivateKey identityKey, org.xipki.security.X509Cert identityCert, org.bouncycastle.asn1.pkcs.CertificationRequest csr, org.bouncycastle.asn1.x500.X500Name issuer) throws ScepClientException
- Throws:
ScepClientException
-
scepCertPoll
public EnrolmentResponse scepCertPoll(java.security.PrivateKey identityKey, org.xipki.security.X509Cert identityCert, TransactionId transactionId, org.bouncycastle.asn1.x500.X500Name issuer, org.bouncycastle.asn1.x500.X500Name subject) throws ScepClientException
- Throws:
ScepClientException
-
scepEnrol
public EnrolmentResponse scepEnrol(org.bouncycastle.asn1.pkcs.CertificationRequest csr, java.security.PrivateKey identityKey, org.xipki.security.X509Cert identityCert) throws ScepClientException
- Throws:
ScepClientException
-
scepPkcsReq
public EnrolmentResponse scepPkcsReq(org.bouncycastle.asn1.pkcs.CertificationRequest csr, java.security.PrivateKey identityKey, org.xipki.security.X509Cert identityCert) throws ScepClientException
- Throws:
ScepClientException
-
scepRenewalReq
public EnrolmentResponse scepRenewalReq(org.bouncycastle.asn1.pkcs.CertificationRequest csr, java.security.PrivateKey identityKey, org.xipki.security.X509Cert identityCert) throws ScepClientException
- Throws:
ScepClientException
-
scepNextCaCert
public AuthorityCertStore scepNextCaCert() throws ScepClientException
- Throws:
ScepClientException
-
destroy
public void destroy()
-
-