@Override public X509Certificate findByIssuerAndSignature(X509Certificate cert) { try { TrustAnchor trustAnchor = (TrustAnchor) findByIssuerAndSignatureMethod.invoke( trustManager, cert); return trustAnchor != null ? trustAnchor.getTrustedCert() : null; } catch (IllegalAccessException e) { throw new AssertionError("unable to get issues and signature", e); } catch (InvocationTargetException e) { return null; } }
@Override public X509Certificate findByIssuerAndSignature(X509Certificate cert) { try { TrustAnchor trustAnchor = (TrustAnchor) findByIssuerAndSignatureMethod.invoke( trustManager, cert); return trustAnchor != null ? trustAnchor.getTrustedCert() : null; } catch (IllegalAccessException e) { throw assertionError("unable to get issues and signature", e); } catch (InvocationTargetException e) { return null; } }
TrustAnchor certificateAuthority = new TrustAnchor((X509Certificate) certificate, null); LOGGER.log(Level.FINE, "Add Certificate Authority {0}: {1}", new Object[]{cert, (certificateAuthority.getTrustedCert() == null ? null : certificateAuthority.getTrustedCert().getSubjectDN())}); anchors.add(certificateAuthority); } catch (IllegalArgumentException e) { TrustAnchor certificateAuthority = new TrustAnchor((X509Certificate) certificate, null); LOGGER.log(Level.FINE, "Add Certificate Authority {0}: {1}", new Object[]{cert, (certificateAuthority.getTrustedCert() == null ? null : certificateAuthority.getTrustedCert().getSubjectDN())}); anchors.add(certificateAuthority); } catch (IllegalArgumentException e) {
TrustAnchor ta = (TrustAnchor)it.next(); X509Certificate cert = ta.getTrustedCert(); System.out.println(cert);
X509Certificate trustedCert = cpvResult.getTrustAnchor().getTrustedCert(); if(trustedCert == null) { throw new CertificateException("certificate path failed: Trusted CA is NULL");
X509Certificate anchorCert = anchor.getTrustedCert(); X500Principal anchorSubjectName = anchorCert.getSubjectX500Principal();
for (TrustAnchor trustAnchor : params.getTrustAnchors()) rootCertificates.add(trustAnchor.getTrustedCert()); for (TrustAnchor trustAnchor : params.getTrustAnchors()) rootCertificates.add(trustAnchor.getTrustedCert());
@Override public synchronized X509Certificate[] getTrustedCertificates() { X509Certificate[] ret = new X509Certificate[anchors.size()]; int i=0; for (TrustAnchor ta: anchors) ret[i++] = ta.getTrustedCert(); return ret; }
@Override public int compare(TrustAnchor lhs, TrustAnchor rhs) { X509Certificate lhsCert = lhs.getTrustedCert(); X509Certificate rhsCert = rhs.getTrustedCert(); return CERT_COMPARATOR.compare(lhsCert, rhsCert); } }
@Override public int compare(TrustAnchor lhs, TrustAnchor rhs) { X509Certificate lhsCert = lhs.getTrustedCert(); X509Certificate rhsCert = rhs.getTrustedCert(); return CERT_COMPARATOR.compare(lhsCert, rhsCert); } }
@Override public X509Certificate[] getTrustedCertificates() { Set<TrustAnchor> anchors = getTrustAnchors(); X509Certificate[] ret = new X509Certificate[anchors.size()]; int i=0; for (TrustAnchor ta: anchors) ret[i++] = ta.getTrustedCert(); return ret; }
@Override public X509Certificate findByIssuerAndSignature(X509Certificate cert) { try { TrustAnchor trustAnchor = (TrustAnchor) findByIssuerAndSignatureMethod.invoke( trustManager, cert); return trustAnchor != null ? trustAnchor.getTrustedCert() : null; } catch (IllegalAccessException e) { throw assertionError("unable to get issues and signature", e); } catch (InvocationTargetException e) { return null; } }
@Override public X509Certificate findByIssuerAndSignature(X509Certificate cert) { try { TrustAnchor trustAnchor = (TrustAnchor) findByIssuerAndSignatureMethod.invoke( trustManager, cert); return trustAnchor != null ? trustAnchor.getTrustedCert() : null; } catch (IllegalAccessException e) { throw assertionError("unable to get issues and signature", e); } catch (InvocationTargetException e) { return null; } }
@Override public X509Certificate findByIssuerAndSignature(X509Certificate cert) { try { TrustAnchor trustAnchor = (TrustAnchor) findByIssuerAndSignatureMethod.invoke( trustManager, cert); return trustAnchor != null ? trustAnchor.getTrustedCert() : null; } catch (IllegalAccessException e) { throw assertionError("unable to get issues and signature", e); } catch (InvocationTargetException e) { return null; } }
@Override public X509Certificate findByIssuerAndSignature(X509Certificate cert) { try { TrustAnchor trustAnchor = (TrustAnchor) findByIssuerAndSignatureMethod.invoke( trustManager, cert); return trustAnchor != null ? trustAnchor.getTrustedCert() : null; } catch (IllegalAccessException e) { throw assertionError("unable to get issues and signature", e); } catch (InvocationTargetException e) { return null; } }
private PkiVerificationData(@Nullable String displayName, PublicKey merchantSigningKey, TrustAnchor rootAuthority) throws PaymentProtocolException.PkiVerificationException { try { this.displayName = displayName; this.merchantSigningKey = merchantSigningKey; this.rootAuthority = rootAuthority; this.rootAuthorityName = X509Utils.getDisplayNameFromCertificate(rootAuthority.getTrustedCert(), true); } catch (CertificateParsingException x) { throw new PaymentProtocolException.PkiVerificationException(x); } }
private PkiVerificationData(@Nullable String displayName, PublicKey merchantSigningKey, TrustAnchor rootAuthority) throws PaymentProtocolException.PkiVerificationException { try { this.displayName = displayName; this.merchantSigningKey = merchantSigningKey; this.rootAuthority = rootAuthority; this.rootAuthorityName = X509Utils.getDisplayNameFromCertificate(rootAuthority.getTrustedCert(), true); } catch (CertificateParsingException x) { throw new PaymentProtocolException.PkiVerificationException(x); } }
private PkiVerificationData(@Nullable String displayName, PublicKey merchantSigningKey, TrustAnchor rootAuthority) throws PaymentProtocolException.PkiVerificationException { try { this.displayName = displayName; this.merchantSigningKey = merchantSigningKey; this.rootAuthority = rootAuthority; this.rootAuthorityName = X509Utils.getDisplayNameFromCertificate(rootAuthority.getTrustedCert(), true); } catch (CertificateParsingException x) { throw new PaymentProtocolException.PkiVerificationException(x); } }
private PkiVerificationData(@Nullable String displayName, PublicKey merchantSigningKey, TrustAnchor rootAuthority) throws PaymentProtocolException.PkiVerificationException { try { this.displayName = displayName; this.merchantSigningKey = merchantSigningKey; this.rootAuthority = rootAuthority; this.rootAuthorityName = X509Utils.getDisplayNameFromCertificate(rootAuthority.getTrustedCert(), true); } catch (CertificateParsingException x) { throw new PaymentProtocolException.PkiVerificationException(x); } }
private PkiVerificationData(@Nullable String displayName, PublicKey merchantSigningKey, TrustAnchor rootAuthority) throws PaymentProtocolException.PkiVerificationException { try { this.displayName = displayName; this.merchantSigningKey = merchantSigningKey; this.rootAuthority = rootAuthority; this.rootAuthorityName = X509Utils.getDisplayNameFromCertificate(rootAuthority.getTrustedCert(), true); } catch (CertificateParsingException x) { throw new PaymentProtocolException.PkiVerificationException(x); } }