public static DecodedPkiMessage decode(CMSSignedData pkiMessage, PrivateKey recipientKey, X509Certificate recipientCert, CollectionStore<X509CertificateHolder> certStore) throws MessageDecodingException { EnvelopedDataDecryptorInstance decInstance = new EnvelopedDataDecryptorInstance( recipientCert, recipientKey); EnvelopedDataDecryptor recipient = new EnvelopedDataDecryptor(decInstance); return decode(pkiMessage, recipient, certStore); }
DecodedPkiMessage resp; try { resp = DecodedPkiMessage.decode(pkiMessage, recipientKey, recipientCert, responseSignerCerts); } catch (MessageDecodingException ex) { throw new ScepClientException(ex);
public ContentInfo servicePkiOperation(CMSSignedData requestContent, String certprofileName, String msgId, AuditEvent event) throws MessageDecodingException, OperationException { if (!isOnService()) { LOG.warn("SCEP {} is not active", caIdent.getName()); throw new OperationException(ErrorCode.SYSTEM_UNAVAILABLE); } DecodedPkiMessage req = DecodedPkiMessage.decode(requestContent, envelopedDataDecryptor, null); PkiMessage rep = servicePkiOperation0(requestContent, req, certprofileName, msgId, event); audit(event, CaAuditConstants.NAME_SCEP_pki_status, rep.getPkiStatus().toString()); if (rep.getPkiStatus() == PkiStatus.FAILURE) { event.setStatus(AuditStatus.FAILED); } if (rep.getFailInfo() != null) { audit(event, CaAuditConstants.NAME_SCEP_fail_info, rep.getFailInfo().toString()); } return encodeResponse(rep, req); } // method servicePkiOperation
EnvelopedDataDecryptor recipient = new EnvelopedDataDecryptor(decInstance); DecodedPkiMessage req = DecodedPkiMessage.decode(requestContent, recipient, null);