Class AcmeCertificateController
- java.lang.Object
-
- de.trustable.ca3s.core.web.rest.acme.AcmeController
-
- de.trustable.ca3s.core.web.rest.acme.AcmeCertificateController
-
@RestController @RequestMapping("/acme/{realm}/cert") public class AcmeCertificateController extends AcmeController
-
-
Field Summary
-
Fields inherited from class de.trustable.ca3s.core.web.rest.acme.AcmeController
APPLICATION_JOSE_JSON, APPLICATION_JOSE_JSON_VALUE, APPLICATION_JWS, APPLICATION_JWS_VALUE, APPLICATION_PEM_CERT, APPLICATION_PEM_CERT_CHAIN, APPLICATION_PEM_CERT_CHAIN_VALUE, APPLICATION_PEM_CERT_VALUE, APPLICATION_PEM_FILE, APPLICATION_PEM_FILE_VALUE, APPLICATION_PKCS12, APPLICATION_PKCS12_VALUE, APPLICATION_PKIX_CERT, APPLICATION_PKIX_CERT_VALUE, APPLICATION_PROBLEM_JSON, APPLICATION_X_PEM_CERT_CHAIN, APPLICATION_X_PEM_CERT_CHAIN_VALUE, DEFAULT_NONCE_VALID_DAYS, HEADER_X_CA3S_FORWARDED_HOST, HEADER_X_CA3S_PROXY_ID, HEADER_X_JWS_SIGNATURE, NO_DETAIL, NO_INSTANCE, REPLAY_NONCE_HEADER
-
-
Constructor Summary
Constructors Constructor Description AcmeCertificateController(CertificateRepository certificateRepository, BPMNUtil bpmnUtil, CertificateUtil certUtil, boolean certificateLocationBackwardCompat)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<?>buildCertifcateResponse(String accept, Certificate certDao)org.springframework.http.ResponseEntity<?>buildCertifcateResponse(String accept, Certificate certDao, org.springframework.http.HttpHeaders headers)org.springframework.http.ResponseEntity<?>buildCertResponseForId(long certId, String accept, String realm, String forwardedHost)org.springframework.http.ResponseEntity<?>getCertificatePKIX(long certId, String accept, String realm, String forwardedHost)org.springframework.http.ResponseEntity<?>retrieveCertificate(String requestBody, String accept, String contentType, long certId, String realm, String forwardedHost)Retrieve a certificate as a PEM structure containing the complete chain Bug in certbot: content type set to 'application/pkix-cert' despite containing a JWT in the request body, as usual.org.springframework.http.ResponseEntity<?>revokeCertificate(String requestBody, String realm)-
Methods inherited from class de.trustable.ca3s.core.web.rest.acme.AcmeController
accountResourceUriBuilderFrom, authorizationResourceUriBuilderFrom, buildNonceHeader, buildProblemResponseEntity, buildUrlFrom, certificateResourceUriBuilderFrom, challengeResourceUriBuilderFrom, checkNonce, contactsFromRequest, directoryResourceUriBuilderFrom, generateId, getBase64UrlEncodedRandom, getNewNonce, getPipelineForRealm, getRandomChallenge, keyChangeResourceUriBuilderFrom, locationUriOfAuth, locationUriOfCertificate, locationUriOfOrder, locationUriOfOrderFinalize, newAccountResourceUriBuilderFrom, newAuthorizationResourceUriBuilderFrom, newNonceResourceUriBuilderFrom, newOrderResourceUriBuilderFrom, orderResourceUriBuilderFrom, revokeResourceUriBuilderFrom
-
-
-
-
Constructor Detail
-
AcmeCertificateController
public AcmeCertificateController(CertificateRepository certificateRepository, BPMNUtil bpmnUtil, CertificateUtil certUtil, @Value("${ca3s.acme.backward.certificate.location:false}") boolean certificateLocationBackwardCompat)
-
-
Method Detail
-
getCertificatePKIX
@RequestMapping(value="/{certId}", method=GET) public org.springframework.http.ResponseEntity<?> getCertificatePKIX(@PathVariable long certId, @RequestHeader(name="Accept",defaultValue="application/pem-certificate-chain") String accept, @PathVariable String realm, @RequestHeader(value="X-CA3S-Forwarded-Host",required=false) String forwardedHost)
-
buildCertResponseForId
public org.springframework.http.ResponseEntity<?> buildCertResponseForId(long certId, String accept, String realm, String forwardedHost) throws org.springframework.web.client.HttpClientErrorException, AcmeProblemException- Throws:
org.springframework.web.client.HttpClientErrorExceptionAcmeProblemException
-
buildCertifcateResponse
public org.springframework.http.ResponseEntity<?> buildCertifcateResponse(String accept, Certificate certDao)
-
buildCertifcateResponse
public org.springframework.http.ResponseEntity<?> buildCertifcateResponse(String accept, Certificate certDao, org.springframework.http.HttpHeaders headers)
- Parameters:
accept- what mime type to beservedcertDao- the certificate to serveheaders- the list of response headers, completed with the certificate's mime type
-
revokeCertificate
@RequestMapping(value="/revoke", method=POST, consumes="application/jose+json") public org.springframework.http.ResponseEntity<?> revokeCertificate(@RequestBody String requestBody, @PathVariable String realm)
-
retrieveCertificate
@RequestMapping(value="/{certId}", method=POST, consumes={"application/jose+json","application/pkix-cert"}) public org.springframework.http.ResponseEntity<?> retrieveCertificate(@RequestBody String requestBody, @RequestHeader(name="Accept",defaultValue="application/pem-certificate-chain") String accept, @RequestHeader("Content-Type") String contentType, @PathVariable long certId, @PathVariable String realm, @RequestHeader(value="X-CA3S-Forwarded-Host",required=false) String forwardedHost)Retrieve a certificate as a PEM structure containing the complete chain Bug in certbot: content type set to 'application/pkix-cert' despite containing a JWT in the request body, as usual.
-
-