Class CaCmpConnector


  • @Service
    public class CaCmpConnector
    extends Object
    • Method Detail

      • revokeCertificate

        public void revokeCertificate​(org.bouncycastle.asn1.x500.X500Name issuerDN,
                                      org.bouncycastle.asn1.x500.X500Name subjectDN,
                                      BigInteger serial,
                                      org.bouncycastle.asn1.x509.CRLReason crlReason,
                                      CAConnectorConfig caConnConfig)
                               throws GeneralSecurityException
        Parameters:
        issuerDN -
        subjectDN -
        serial -
        crlReason -
        caConnConfig -
        Throws:
        GeneralSecurityException
      • readCertResponse

        public Certificate readCertResponse​(de.trustable.cmp.client.cmpClient.CMPClientImpl.CertificateResponseContent certificateResponseContent,
                                            CSR csr,
                                            CAConnectorConfig config)
                                     throws GeneralSecurityException
        public GenMsgContent getGeneralInfo(String hmacSecret, String cmpEndpoint, String alias) throws GeneralSecurityException { try { PKIMessage pkiMessage = cryptoUtil.buildGeneralMessageRequest(hmacSecret); // send and receive .. LOGGER.debug("general info requestBytes : " + java.util.Base64.getEncoder().encodeToString(pkiMessage.getEncoded())); byte[] responseBytes = remoteConnector.sendHttpReq(cmpEndpoint + "/" + alias, pkiMessage.getEncoded()); LOGGER.debug("general info responseBytes : " + java.util.Base64.getEncoder().encodeToString(responseBytes)); // handle the response return cryptoUtil.readGenMsgResponse(responseBytes, hmacSecret); } catch (CRMFException e) { LOGGER.info("CMS format problem", e); throw new GeneralSecurityException(e.getMessage()); } catch (CMPException e) { LOGGER.info("CMP problem", e); throw new GeneralSecurityException(e.getMessage()); } catch (IOException e) { if( LOGGER.isDebugEnabled()){ LOGGER.debug("IO / encoding problem", e); }else { LOGGER.info("IO / encoding problem: {}", e.getMessage()); } throw new GeneralSecurityException(e.getMessage()); } }
        Throws:
        GeneralSecurityException