@Test public void givenRealmWhenP12NotGrantedThenReturnNull() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { final InputStream inStream = new FileInputStream("src/test/resources/tls/client/client_notgranted.p12"); final KeyStore ks = KeyStore.getInstance("PKCS12"); ks.load(inStream, "vitam2016".toCharArray()); final String alias = ks.aliases().nextElement(); final X509Certificate certificate = (X509Certificate) ks.getCertificate(alias); final X509Certificate[] clientCertChain = new X509Certificate[] {certificate}; final X509AuthenticationToken token = new X509AuthenticationToken(clientCertChain, "XXX"); final X509AuthenticationInfo info = (X509AuthenticationInfo) realm.doGetAuthenticationInfo(token); assertNull(info); }
@Override protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) { return doGetX509AuthenticationInfo((X509AuthenticationToken) token); }
X509KeystoreFileRealm extends AbstractX509Realm { @Override protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) { return doGetX509AuthenticationInfo((X509AuthenticationToken) token); } }
X509KeystoreFileRealm extends AbstractX509Realm { @Override protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) { return doGetX509AuthenticationInfo((X509AuthenticationToken) token); } X509KeystoreFileRealm(); }
X509KeystoreFileRealm extends AbstractX509Realm { @Override protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) { return doGetX509AuthenticationInfo((X509AuthenticationToken) token); } X509KeystoreFileRealm(); @Override boolean supports(AuthenticationToken token); @Override Class<X509AuthenticationToken> getAuthenticationTokenClass(); Map<String, String> getCertificateDnRoleMapping(); void setCertificateDnRoleMapping(Map<String, String> certificateDnRoleMapping); }
X509KeystoreFileRealm extends AbstractX509Realm { @Override protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) { return doGetX509AuthenticationInfo((X509AuthenticationToken) token); } X509KeystoreFileRealm(); @Override boolean supports(AuthenticationToken token); @Override Class<X509AuthenticationToken> getAuthenticationTokenClass(); Map<String, String> getCertificateDnRoleMapping(); void setCertificateDnRoleMapping(Map<String, String> certificateDnRoleMapping);  }