本文整理了Java中org.bouncycastle.cert.ocsp.BasicOCSPResp.getCerts()
方法的一些代码示例,展示了BasicOCSPResp.getCerts()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BasicOCSPResp.getCerts()
方法的具体详情如下:
包路径:org.bouncycastle.cert.ocsp.BasicOCSPResp
类名称:BasicOCSPResp
方法名:getCerts
BasicOCSPResp.getCerts介绍
暂无
代码示例
代码示例来源:origin: apache/nifi
final X509CertificateHolder[] respOnderCertificates= basicOcspResponse.getCerts();
if (responderCertificates.length != 1) {
logger.warn(String.format("Unexpected number of OCSP responder certificates: %s", responderCertificates.length));
代码示例来源:origin: apache/pdfbox
private void findResponderCertificateByKeyHash(BasicOCSPResp basicResponse, byte[] keyHash)
throws IOException
X509CertificateHolder[] certHolders = basicResponse.getCerts();
for (X509CertificateHolder certHolder : certHolders)
代码示例来源:origin: apache/pdfbox
private void findResponderCertificateByName(BasicOCSPResp basicResponse, X500Name name)
X509CertificateHolder[] certHolders = basicResponse.getCerts();
for (X509CertificateHolder certHolder : certHolders)
代码示例来源:origin: apache/pdfbox
Set additionalCerts2 = new HashSet<>(additionalCerts);
JcaX509CertificateConverter certificateCOnverter= new JcaX509CertificateConverter();
for (X509CertificateHolder certHolder : basicResponse.getCerts())
代码示例来源:origin: apache/pdfbox
BasicOCSPResp basicRespOnse= (BasicOCSPResp) ocspResp.getResponseObject();
X509Certificate ocspRespOnderCertificate= ocspHelper.getOcspResponderCertificate();
certInformationHelper.addAllCertsFromHolders(basicResponse.getCerts());
byte[] signatureHash;
try
代码示例来源:origin: itext/itext7
static Iterable getCertsFromOcspResponse(BasicOCSPResp ocspResp) {
List certs = new ArrayList<>();
X509CertificateHolder[] certHolders = ocspResp.getCerts();
JcaX509CertificateConverter cOnverter= new JcaX509CertificateConverter();
for (X509CertificateHolder certHolder : certHolders) {
try {
certs.add(converter.getCertificate(certHolder));
} catch (Exception ex) {
}
}
return certs;
}
代码示例来源:origin: com.itextpdf/sign
static Iterable getCertsFromOcspResponse(BasicOCSPResp ocspResp) {
List certs = new ArrayList<>();
X509CertificateHolder[] certHolders = ocspResp.getCerts();
JcaX509CertificateConverter cOnverter= new JcaX509CertificateConverter();
for (X509CertificateHolder certHolder : certHolders) {
try {
certs.add(converter.getCertificate(certHolder));
} catch (Exception ex) {
}
}
return certs;
}
代码示例来源:origin: arhs/sd-dss
private boolean extractSigningCertificateFromResponse(final CertificatePool certificatePool) {
for (final X509CertificateHolder x509CertificateHolder : basicOCSPResp.getCerts()) {
final byte[] encoded = DSSUtils.getEncoded(x509CertificateHolder);
final X509Certificate x509Certificate = DSSUtils.loadCertificate(encoded);
final CertificateToken certToken = certificatePool.getInstance(x509Certificate, CertificateSourceType.OCSP_RESPONSE);
if (isSignedBy(certToken)) {
return true;
}
}
return false;
}
代码示例来源:origin: org.apache.pdfbox/pdfbox-examples
private void findResponderCertificateByName(BasicOCSPResp basicResponse, X500Name name)
X509CertificateHolder[] certHolders = basicResponse.getCerts();
for (X509CertificateHolder certHolder : certHolders)
代码示例来源:origin: eu.eu-emi.security/canl
private PublicKey establishResponsePubKey(BasicOCSPResp bresp, X509Certificate issuerCert) throws OCSPException
X509CertificateHolder[] signerCerts = bresp.getCerts();
if (signerCerts == null || signerCerts.length == 0)
return issuerCert.getPublicKey();
代码示例来源:origin: open-eid/digidoc4j
private void verifyResponse(BasicOCSPResp response) throws IOException {
List holders = Arrays.asList(response.getCerts());
if (CollectionUtils.isNotEmpty(holders)) {
for (X509CertificateHolder holder : holders) {
CertificateToken token = DSSUtils.loadCertificate(holder.getEncoded());
List tokens = this.configuration.getTSL().get(
token.getCertificate().getSubjectX500Principal());
if (CollectionUtils.isEmpty(tokens) || tokens.size() != 1) {
throw new SignatureVerificationException(String.format("OCSP response certificate <%s> match is not found " +
"in TSL (<%s> results in total)", token.getDSSIdAsString(), tokens.size()));
} else {
try {
ContentVerifierProvider provider = new JcaContentVerifierProviderBuilder().setProvider("BC").build(new
X509CertificateHolder(tokens.get(0).getEncoded()));
if (!response.isSignatureValid(provider)) {
throw new SignatureVerificationException("OCSP response signature is invalid");
}
} catch (SignatureVerificationException e) {
throw e;
} catch (Exception e) {
throw new SignatureVerificationException("Unable to verify response signature", e);
}
}
}
} else {
if (!this.configuration.isTest()) {
LOGGER.warn("OCSP response signature will not be verified. No response certificates has been found");
}
}
}
代码示例来源:origin: org.apache.pdfbox/pdfbox-examples
Set additionalCerts2 = new HashSet(additionalCerts);
JcaX509CertificateConverter certificateCOnverter= new JcaX509CertificateConverter();
for (X509CertificateHolder certHolder : basicResponse.getCerts())
代码示例来源:origin: org.apache.pdfbox/pdfbox-examples
certInformationHelper.addAllCertsFromHolders(basicResponse.getCerts());
代码示例来源:origin: com.itextpdf/itextpdf
if (ocspResp.getCerts() != null) {
X509CertificateHolder[] certs = ocspResp.getCerts();
for (X509CertificateHolder cert : certs) {
X509Certificate tempCert;
代码示例来源:origin: org.keycloak/keycloak-common
private static void verifyResponse(BasicOCSPResp basicOcspResponse, X509Certificate issuerCertificate, X509Certificate responderCertificate, byte[] requestNonce, Date date) throws NoSuchProviderException, NoSuchAlgorithmException, CertificateNotYetValidException, CertificateExpiredException, CertPathValidatorException {
List certs = new ArrayList<>(Arrays.asList(basicOcspResponse.getCerts()));
X509Certificate signingCert = null;
代码示例来源:origin: be.fedict.jtrust/jtrust-lib
BasicOCSPResp basicOCSPResp = (BasicOCSPResp) responseObject;
X509CertificateHolder[] respOnseCertificates= basicOCSPResp.getCerts();
for (X509CertificateHolder responseCertificate : responseCertificates) {
LOG.debug("OCSP response cert: " + responseCertificate.getSubject());
代码示例来源:origin: poreid/poreid
X509CertificateHolder certHolder = basicResponse.getCerts()[0];
if (!basicResponse.isSignatureValid(new JcaContentVerifierProviderBuilder().setProvider("BC").build(issuer))){
if (!certHolder.isValidOn(Date.from(Instant.now()))){
代码示例来源:origin: itext/itext7
if (ocspResp.getCerts() != null) {
代码示例来源:origin: org.apache.nifi/nifi-web-security
final X509CertificateHolder[] respOnderCertificates= basicOcspResponse.getCerts();
if (responderCertificates.length != 1) {
logger.warn(String.format("Unexpected number of OCSP responder certificates: %s", responderCertificates.length));
代码示例来源:origin: com.itextpdf/sign
if (ocspResp.getCerts() != null) {