private static TrustAnchor findBySubjectAndPublicKey(X509Certificate cert, Collection<TrustAnchor> anchors) { PublicKey certPublicKey = cert.getPublicKey(); for (TrustAnchor anchor : anchors) { PublicKey caPublicKey; try { X509Certificate caCert = anchor.getTrustedCert(); if (caCert != null) { caPublicKey = caCert.getPublicKey(); } else { caPublicKey = anchor.getCAPublicKey(); } if (caPublicKey.equals(certPublicKey)) { return anchor; } } catch (Exception e) { // can happen with unsupported public key types } } return null; } }
public TrustAnchor findByIssuerAndSignature(X509Certificate cert) { X500Principal issuer = cert.getIssuerX500Principal(); synchronized (subjectToTrustAnchors) { List<TrustAnchor> anchors = subjectToTrustAnchors.get(issuer); if (anchors == null) { return null; } for (TrustAnchor anchor : anchors) { PublicKey publicKey; try { X509Certificate caCert = anchor.getTrustedCert(); if (caCert != null) { publicKey = caCert.getPublicKey(); } else { publicKey = anchor.getCAPublicKey(); } cert.verify(publicKey); return anchor; } catch (Exception ignored) { } } } return null; }
public TrustAnchor findByIssuerAndSignature(X509Certificate cert) { X500Principal issuer = cert.getIssuerX500Principal(); synchronized (subjectToTrustAnchors) { List<TrustAnchor> anchors = subjectToTrustAnchors.get(issuer); if (anchors == null) { return null; } for (TrustAnchor anchor : anchors) { PublicKey publicKey; try { X509Certificate caCert = anchor.getTrustedCert(); if (caCert != null) { publicKey = caCert.getPublicKey(); } else { publicKey = anchor.getCAPublicKey(); } cert.verify(publicKey); return anchor; } catch (Exception ignored) { } } } return null; }
private static TrustAnchor findBySubjectAndPublicKey(X509Certificate cert, Collection<TrustAnchor> anchors) { PublicKey certPublicKey = cert.getPublicKey(); for (TrustAnchor anchor : anchors) { PublicKey caPublicKey; try { X509Certificate caCert = anchor.getTrustedCert(); if (caCert != null) { caPublicKey = caCert.getPublicKey(); } else { caPublicKey = anchor.getCAPublicKey(); } if (caPublicKey.equals(certPublicKey)) { return anchor; } } catch (Exception e) { // can happen with unsupported public key types } } return null; } }
public TrustAnchor findByIssuerAndSignature(X509Certificate cert) { X500Principal issuer = cert.getIssuerX500Principal(); synchronized (subjectToTrustAnchors) { List<TrustAnchor> anchors = subjectToTrustAnchors.get(issuer); if (anchors == null) { return null; } for (TrustAnchor anchor : anchors) { PublicKey publicKey; try { X509Certificate caCert = anchor.getTrustedCert(); if (caCert != null) { publicKey = caCert.getPublicKey(); } else { publicKey = anchor.getCAPublicKey(); } cert.verify(publicKey); return anchor; } catch (Exception ignored) { } } } return null; }
public TrustAnchor findByIssuerAndSignature(X509Certificate cert) { X500Principal issuer = cert.getIssuerX500Principal(); synchronized (subjectToTrustAnchors) { List<TrustAnchor> anchors = subjectToTrustAnchors.get(issuer); if (anchors == null) { return null; } for (TrustAnchor anchor : anchors) { PublicKey publicKey; try { X509Certificate caCert = anchor.getTrustedCert(); if (caCert != null) { publicKey = caCert.getPublicKey(); } else { publicKey = anchor.getCAPublicKey(); } cert.verify(publicKey); return anchor; } catch (Exception ignored) { } } } return null; }
public Set<TrustAnchor> findAllByIssuerAndSignature(X509Certificate cert) { X500Principal issuer = cert.getIssuerX500Principal(); synchronized (subjectToTrustAnchors) { List<TrustAnchor> anchors = subjectToTrustAnchors.get(issuer); if (anchors == null) { return Collections.<TrustAnchor>emptySet(); } Set<TrustAnchor> result = new HashSet<TrustAnchor>(); for (TrustAnchor anchor : anchors) { try { PublicKey publicKey; X509Certificate caCert = anchor.getTrustedCert(); if (caCert != null) { publicKey = caCert.getPublicKey(); } else { publicKey = anchor.getCAPublicKey(); } if (publicKey == null) { continue; } cert.verify(publicKey); result.add(anchor); } catch (Exception ignored) { } } return result; } }
public Set<TrustAnchor> findAllByIssuerAndSignature(X509Certificate cert) { X500Principal issuer = cert.getIssuerX500Principal(); synchronized (subjectToTrustAnchors) { List<TrustAnchor> anchors = subjectToTrustAnchors.get(issuer); if (anchors == null) { return Collections.<TrustAnchor>emptySet(); } Set<TrustAnchor> result = new HashSet<TrustAnchor>(); for (TrustAnchor anchor : anchors) { try { PublicKey publicKey; X509Certificate caCert = anchor.getTrustedCert(); if (caCert != null) { publicKey = caCert.getPublicKey(); } else { publicKey = anchor.getCAPublicKey(); } if (publicKey == null) { continue; } cert.verify(publicKey); result.add(anchor); } catch (Exception ignored) { } } return result; } }
caPublicKey = caCert.getPublicKey(); } else { caPublicKey = anchor.getCAPublicKey();
caPublicKey = caCert.getPublicKey(); } else { caPublicKey = anchor.getCAPublicKey();
&& trust.getCAPublicKey() != null) if (certIssuer.equals(caName)) trustPublicKey = trust.getCAPublicKey();
&& trust.getCAPublicKey() != null) if (certIssuer.equals(caName)) trustPublicKey = trust.getCAPublicKey();
&& trust.getCAPublicKey() != null) if (certIssuer.equals(caName)) trustPublicKey = trust.getCAPublicKey();
&& trust.getCAPublicKey() != null) if (certIssuer.equals(caName)) trustPublicKey = trust.getCAPublicKey();
&& trust.getCAPublicKey() != null) if (certIssuer.equals(caName)) trustPublicKey = trust.getCAPublicKey();
&& trust.getCAPublicKey() != null) if (certIssuer.equals(caName)) trustPublicKey = trust.getCAPublicKey();
else if (trust.getCAName() != null && trust.getCAPublicKey() != null)
else if (trust.getCAName() != null && trust.getCAPublicKey() != null)
else if (trust.getCAName() != null && trust.getCAPublicKey() != null)
else if (trust.getCAName() != null && trust.getCAPublicKey() != null)