Search in sources :

Example 6 with PublicLdapCertificateStoreProvider

use of org.nhindirect.stagent.cert.impl.provider.PublicLdapCertificateStoreProvider in project nhin-d by DirectProject.

the class LdapCertificateStoreTest method testPublicLdapSearch_orgLevelCert_assertCertExists.

public void testPublicLdapSearch_orgLevelCert_assertCertExists() throws Exception {
    addStockPublicLDAPCertificats();
    PublicLdapCertificateStoreProvider provider = new PublicLdapCertificateStoreProvider(null, null);
    CertificateResolver resolver = provider.get();
    Collection<X509Certificate> certs = resolver.getCertificates(new InternetAddress("testdomain.com"));
    assertEquals(1, certs.size());
    X509Certificate cert = certs.iterator().next();
    assertTrue(cert.getSubjectX500Principal().toString().contains("direct.fnhubapp01.qa.medplus.com"));
}
Also used : InternetAddress(javax.mail.internet.InternetAddress) CertificateResolver(org.nhindirect.stagent.cert.CertificateResolver) PublicLdapCertificateStoreProvider(org.nhindirect.stagent.cert.impl.provider.PublicLdapCertificateStoreProvider) X509Certificate(java.security.cert.X509Certificate)

Aggregations

PublicLdapCertificateStoreProvider (org.nhindirect.stagent.cert.impl.provider.PublicLdapCertificateStoreProvider)6 CertificateResolver (org.nhindirect.stagent.cert.CertificateResolver)5 X509Certificate (java.security.cert.X509Certificate)4 InternetAddress (javax.mail.internet.InternetAddress)4 LDAPCertificateStore (org.nhindirect.stagent.cert.impl.LDAPCertificateStore)3 Provider (com.google.inject.Provider)2 ArrayList (java.util.ArrayList)2 AddressException (javax.mail.internet.AddressException)2 SmtpAgentException (org.nhindirect.gateway.smtp.SmtpAgentException)2 PolicyParseException (org.nhindirect.policy.PolicyParseException)2 DNSCertificateStore (org.nhindirect.stagent.cert.impl.DNSCertificateStore)2 DNSCertStoreProvider (org.nhindirect.stagent.cert.impl.provider.DNSCertStoreProvider)2 KeyStoreCertificateStoreProvider (org.nhindirect.stagent.cert.impl.provider.KeyStoreCertificateStoreProvider)2 LdapCertificateStoreProvider (org.nhindirect.stagent.cert.impl.provider.LdapCertificateStoreProvider)2 PublicCertStoreModule (org.nhindirect.stagent.module.PublicCertStoreModule)2 DomainPolicyResolverProvider (org.nhindirect.stagent.policy.impl.provider.DomainPolicyResolverProvider)2 MultiDomainTrustAnchorResolverProvider (org.nhindirect.stagent.trust.provider.MultiDomainTrustAnchorResolverProvider)2 UniformTrustAnchorResolverProvider (org.nhindirect.stagent.trust.provider.UniformTrustAnchorResolverProvider)2 File (java.io.File)1 IOException (java.io.IOException)1