@Test public void noCredentials() throws NamingException { SSLAwareTokenResolver tr = new SSLAwareTokenResolver<Object,Object,Object>(new CommonNameCertInfoExtractor()) { public List<IdentityToken> resolve(Object input, Object transportAuthTokens) { return null; } public void rewrite(List<IdentityToken> credentials, Object output) {} public boolean isRewriteSupported() { return false; } }; assertNull(tr.findCertInfo(null)); }
protected String findCertInfo(X509Certificate[] x509certificates) throws NamingException { if (x509certificates != null && x509certificates.length != 0) { Principal subject = x509certificates[0].getSubjectDN(); if (subject != null && subject.getName() != null) { List<Rdn> rdns; try { rdns = new LdapName(subject.getName()).getRdns(); } catch (InvalidNameException ine) { return null; } return certInfoExtractor.extractCertInfo(rdns); } } return null; }
SSLAwareTokenResolver implements IdentityTokenResolver<I,O,C> { protected String findCertInfo(X509Certificate[] x509certificates) throws NamingException { if (x509certificates != null && x509certificates.length != 0) { Principal subject = x509certificates[0].getSubjectDN(); if (subject != null && subject.getName() != null) { List<Rdn> rdns; try { rdns = new LdapName(subject.getName()).getRdns(); } catch (InvalidNameException ine) { return null; } return certInfoExtractor.extractCertInfo(rdns); } } return null; } }
SSLAwareTokenResolver implements IdentityTokenResolver<I,O,C> { protected String findCertInfo(X509Certificate[] x509certificates) throws NamingException { if (x509certificates != null && x509certificates.length != 0) { Principal subject = x509certificates[0].getSubjectDN(); if (subject != null && subject.getName() != null) { List<Rdn> rdns; try { rdns = new LdapName(subject.getName()).getRdns(); } catch (InvalidNameException ine) { return null; } return certInfoExtractor.extractCertInfo(rdns); } } return null; } protected  SSLAwareTokenResolver(CertInfoExtractor certInfoExtractor); }
SSLAwareTokenResolver implements IdentityTokenResolver<I,O,C> { protected String findCertInfo(X509Certificate[] x509certificates) throws NamingException { if (x509certificates != null && x509certificates.length != 0) { Principal subject = x509certificates[0].getSubjectDN(); if (subject != null && subject.getName() != null) { List<Rdn> rdns; try { rdns = new LdapName(subject.getName()).getRdns(); } catch (InvalidNameException ine) { return null; } return certInfoExtractor.extractCertInfo(rdns); } } return null; } protected  SSLAwareTokenResolver(CertInfoExtractor certInfoExtractor);  }
SSLAwareTokenResolver implements IdentityTokenResolver<I,O,C> { protected String findCertInfo(X509Certificate[] x509certificates) throws NamingException { if (x509certificates != null && x509certificates.length != 0) { Principal subject = x509certificates[0].getSubjectDN(); if (subject != null && subject.getName() != null) { List<Rdn> rdns; try { rdns = new LdapName(subject.getName()).getRdns(); } catch (InvalidNameException ine) { return null; } return certInfoExtractor.extractCertInfo(rdns); } } return null; } protected  SSLAwareTokenResolver(CertInfoExtractor certInfoExtractor);  static final String SSL_CERT_INFO; }