Class CertificateDownloadController
- java.lang.Object
-
- de.trustable.ca3s.core.web.rest.support.CertificateDownloadController
-
@Controller @RequestMapping("/publicapi") public class CertificateDownloadController extends Object
-
-
Constructor Summary
Constructors Constructor Description CertificateDownloadController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<byte[]>buildByteArrayResponseForId(long certId, String accept, String alias, String filename)org.springframework.http.ResponseEntity<?>buildCertifcateResponse(String accept, Certificate certDao, org.springframework.http.HttpHeaders headers)org.springframework.http.ResponseEntity<?>buildCertResponseForId(long certId, String accept, String filename)org.springframework.http.ResponseEntity<?>getCertificate(long certId, String accept)Public certificate download endpointorg.springframework.http.ResponseEntity<?>getCertificatePEM(long certId, String filename)Public certificate download endpoint providing PEM formatorg.springframework.http.ResponseEntity<?>getCertificatePEMChain(long certId, String filename)Public certificate download endpoint providing PEM format including the certificate chainorg.springframework.http.ResponseEntity<byte[]>getCertificatePKIX(long certId, String filename)Public certificate download endpoint providing DER formatorg.springframework.http.ResponseEntity<byte[]>getKeystore(long certId, String filename, String alias, String accept)Keystore download endpoint
-
-
-
Method Detail
-
getCertificatePKIX
@RequestMapping(value="/certPKIX/{certId}/{filename}", method=GET, produces="application/pkix-cert") public org.springframework.http.ResponseEntity<byte[]> getCertificatePKIX(@PathVariable long certId, @PathVariable String filename) throws de.trustable.ca3s.core.web.rest.support.NotFoundExceptionPublic certificate download endpoint providing DER format- Parameters:
certId- the internal certificate id- Returns:
- the binary certificate
- Throws:
de.trustable.ca3s.core.web.rest.support.NotFoundException
-
getCertificatePEMChain
@RequestMapping(value="/certPEMChain/{certId}/{filename}", method=GET) public org.springframework.http.ResponseEntity<?> getCertificatePEMChain(@PathVariable long certId, @PathVariable String filename)Public certificate download endpoint providing PEM format including the certificate chain- Parameters:
certId- the internal certificate id- Returns:
- the PEM-encoded certificate chain
-
getCertificatePEM
@RequestMapping(value="/certPEM/{certId}/{filename}", method=GET) public org.springframework.http.ResponseEntity<?> getCertificatePEM(@PathVariable long certId, @PathVariable String filename)Public certificate download endpoint providing PEM format- Parameters:
certId- the internal certificate id- Returns:
- the PEM-encoded certificate
-
getCertificate
@RequestMapping(value="/cert/{certId}", method=GET) public org.springframework.http.ResponseEntity<?> getCertificate(@PathVariable long certId, @RequestHeader(name="Accept",defaultValue="application/pem-certificate-chain") String accept)Public certificate download endpoint- Parameters:
certId- the internal certificate idaccept- the description of the requested format- Returns:
- the certificate in the requested encoded form
-
getKeystore
@RequestMapping(value="/keystore/{certId}/{filename}/{alias}", method=GET, produces="application/x-pkcs12") public org.springframework.http.ResponseEntity<byte[]> getKeystore(@PathVariable long certId, @PathVariable String filename, @PathVariable String alias, @RequestHeader(name="Accept",defaultValue="application/x-pkcs12") String accept) throws de.trustable.ca3s.core.web.rest.support.NotFoundExceptionKeystore download endpoint- Parameters:
certId- the internal certificate idfilename- the requested file name, for logging purposes onlyalias- the identification id within the keystoreaccept- the description of the requested format- Returns:
- the certificate in the requested encoded form
- Throws:
de.trustable.ca3s.core.web.rest.support.NotFoundException
-
buildCertResponseForId
public org.springframework.http.ResponseEntity<?> buildCertResponseForId(long certId, String accept, String filename) throws org.springframework.web.client.HttpClientErrorException, AcmeProblemException- Parameters:
certId-accept-filename-- Returns:
- Throws:
org.springframework.web.client.HttpClientErrorExceptionAcmeProblemException
-
buildByteArrayResponseForId
public org.springframework.http.ResponseEntity<byte[]> buildByteArrayResponseForId(long certId, String accept, String alias, String filename) throws org.springframework.web.client.HttpClientErrorException, AcmeProblemException, GeneralSecurityException- Parameters:
certId-accept-alias-filename-- Returns:
- Throws:
org.springframework.web.client.HttpClientErrorExceptionAcmeProblemExceptionGeneralSecurityException
-
buildCertifcateResponse
public org.springframework.http.ResponseEntity<?> buildCertifcateResponse(String accept, Certificate certDao, org.springframework.http.HttpHeaders headers)
- Parameters:
accept-certDao-headers-
-
-