Class ESTService
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected EnrollmentResponse
enroll
(boolean reenroll, PKCS10CertificationRequest certificationRequest, ESTAuth auth, boolean certGen) Perform a simple enrollment operation.enrollPop
(boolean reEnroll, PKCS10CertificationRequestBuilder builder, ContentSigner contentSigner, ESTAuth auth, boolean certGen) Implements Enroll with PoP.Query the EST server for ca certificates.Fetch he CSR Attributes from the server.protected EnrollmentResponse
Handles an enrollment response, deals with status codes and setting of delays.simpleEnroll
(boolean reenroll, PKCS10CertificationRequest certificationRequest, ESTAuth auth) Perform a simple enrollment operation.simpleEnroll
(EnrollmentResponse priorResponse) Reissue an existing request where the server had previously returned a 202.simpleEnrollPoP
(boolean reEnroll, PKCS10CertificationRequestBuilder builder, ContentSigner contentSigner, ESTAuth auth) Implements Enroll with PoP.simpleEnrollPopWithServersideCreation
(PKCS10CertificationRequestBuilder builder, ContentSigner contentSigner, ESTAuth auth) Simple enrollment with PoP and server side creation of keys.simpleEnrollWithServersideCreation
(PKCS10CertificationRequest certificationRequest, ESTAuth auth) Perform a simple enrollment operation.static X509CertificateHolder[]
storeToArray
(org.bouncycastle.util.Store<X509CertificateHolder> store) Utility method to extract all the X509Certificates from a store and return them in an array.static X509CertificateHolder[]
storeToArray
(org.bouncycastle.util.Store<X509CertificateHolder> store, org.bouncycastle.util.Selector<X509CertificateHolder> selector) Utility method to extract all the X509Certificates from a store using a filter and to return them as an array.
-
Field Details
-
CACERTS
- See Also:
-
SIMPLE_ENROLL
- See Also:
-
SIMPLE_REENROLL
- See Also:
-
FULLCMC
- See Also:
-
SERVERGEN
- See Also:
-
CSRATTRS
- See Also:
-
illegalParts
-
-
Method Details
-
storeToArray
public static X509CertificateHolder[] storeToArray(org.bouncycastle.util.Store<X509CertificateHolder> store) Utility method to extract all the X509Certificates from a store and return them in an array.- Parameters:
store
- The store.- Returns:
- An arrar of certificates/
-
storeToArray
public static X509CertificateHolder[] storeToArray(org.bouncycastle.util.Store<X509CertificateHolder> store, org.bouncycastle.util.Selector<X509CertificateHolder> selector) Utility method to extract all the X509Certificates from a store using a filter and to return them as an array.- Parameters:
store
- The store.selector
- The selector.- Returns:
- An array of X509Certificates.
-
getCACerts
Query the EST server for ca certificates.RFC7030 leans heavily on the verification phases of TLS for both client and server verification.
It does however define a bootstrapping mode where if the client does not have the necessary ca certificates to validate the server it can defer to an external source, such as a human, to formally accept the ca certs.
If callers are using bootstrapping they must examine the CACertsResponse and validate it externally.
- Returns:
- A store of X509Certificates.
- Throws:
ESTException
-
simpleEnroll
Reissue an existing request where the server had previously returned a 202.- Parameters:
priorResponse
- The prior response.- Returns:
- A new ESTEnrollmentResponse
- Throws:
Exception
-
enroll
protected EnrollmentResponse enroll(boolean reenroll, PKCS10CertificationRequest certificationRequest, ESTAuth auth, boolean certGen) throws IOException Perform a simple enrollment operation.This method accepts an ESPHttpAuth instance to provide basic or digest authentication.
If authentication is to be performed as part of TLS then this instances client keystore and their keystore password need to be specified.
- Parameters:
certificationRequest
- The certification request.auth
- The http auth provider, basic auth or digest auth, can be null.certGen
- if true, request server key generation- Returns:
- The enrolled certificate.
- Throws:
IOException
-
simpleEnroll
public EnrollmentResponse simpleEnroll(boolean reenroll, PKCS10CertificationRequest certificationRequest, ESTAuth auth) throws IOException Perform a simple enrollment operation.This method accepts an ESPHttpAuth instance to provide basic or digest authentication.
If authentication is to be performed as part of TLS then this instances client keystore and their keystore password need to be specified.
- Parameters:
reenroll
- true for enrollment.certificationRequest
- The certification request.auth
- The http auth provider, basic auth or digest auth, can be null.- Returns:
- The enrolled certificate.
- Throws:
IOException
-
simpleEnrollWithServersideCreation
public EnrollmentResponse simpleEnrollWithServersideCreation(PKCS10CertificationRequest certificationRequest, ESTAuth auth) throws IOException Perform a simple enrollment operation.This method accepts an ESPHttpAuth instance to provide basic or digest authentication.
If authentication is to be performed as part of TLS then this instances client keystore and their keystore password need to be specified.
- Parameters:
certificationRequest
- The certification request.auth
- The http auth provider, basic auth or digest auth, can be null.- Returns:
- The enrolled certificate.
- Throws:
IOException
-
enrollPop
public EnrollmentResponse enrollPop(boolean reEnroll, PKCS10CertificationRequestBuilder builder, ContentSigner contentSigner, ESTAuth auth, boolean certGen) throws IOException Implements Enroll with PoP. Request will have the tls-unique attribute added to it before it is signed and completed.- Parameters:
reEnroll
- True = re enroll.builder
- The request builder.contentSigner
- The content signer.auth
- Auth modes.certGen
- if true will request server key generation.- Returns:
- Enrollment response.
- Throws:
IOException
-
simpleEnrollPoP
public EnrollmentResponse simpleEnrollPoP(boolean reEnroll, PKCS10CertificationRequestBuilder builder, ContentSigner contentSigner, ESTAuth auth) throws IOException Implements Enroll with PoP. Request will have the tls-unique attribute added to it before it is signed and completed.- Parameters:
reEnroll
- True = re enroll.builder
- The request builder.contentSigner
- The content signer.auth
- Auth modes.- Returns:
- Enrollment response.
- Throws:
IOException
-
simpleEnrollPopWithServersideCreation
public EnrollmentResponse simpleEnrollPopWithServersideCreation(PKCS10CertificationRequestBuilder builder, ContentSigner contentSigner, ESTAuth auth) throws IOException Simple enrollment with PoP and server side creation of keys.- Parameters:
builder
- The request builder.contentSigner
- The content signerauth
- Auth modes- Returns:
- Enrollment Response
- Throws:
IOException
-
handleEnrollResponse
Handles an enrollment response, deals with status codes and setting of delays.- Parameters:
resp
- The response.- Returns:
- An EnrollmentResponse.
- Throws:
IOException
-
getCSRAttributes
Fetch he CSR Attributes from the server.- Returns:
- A CSRRequestResponse with the attributes.
- Throws:
ESTException
-