Search in sources :

Example 26 with GeneralSubtree

use of com.github.zhenwei.core.asn1.x509.GeneralSubtree in project LinLong-Java by zhenwei1108.

the class PKIXNameConstraintValidator method intersectEmail.

private Set intersectEmail(Set permitted, Set emails) {
    Set intersect = new HashSet();
    for (Iterator it = emails.iterator(); it.hasNext(); ) {
        String email = extractNameAsString(((GeneralSubtree) it.next()).getBase());
        if (permitted == null) {
            if (email != null) {
                intersect.add(email);
            }
        } else {
            Iterator it2 = permitted.iterator();
            while (it2.hasNext()) {
                String _permitted = (String) it2.next();
                intersectEmail(email, _permitted, intersect);
            }
        }
    }
    return intersect;
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) Iterator(java.util.Iterator) ASN1IA5String(com.github.zhenwei.core.asn1.ASN1IA5String) ASN1OctetString(com.github.zhenwei.core.asn1.ASN1OctetString) HashSet(java.util.HashSet)

Aggregations

GeneralSubtree (org.bouncycastle.asn1.x509.GeneralSubtree)18 BigInteger (java.math.BigInteger)7 GeneralName (org.bouncycastle.asn1.x509.GeneralName)6 NameConstraints (org.bouncycastle.asn1.x509.NameConstraints)6 IOException (java.io.IOException)5 X509Certificate (java.security.cert.X509Certificate)5 HashSet (java.util.HashSet)4 Iterator (java.util.Iterator)4 Set (java.util.Set)4 X500Name (org.bouncycastle.asn1.x500.X500Name)4 GeneralSecurityException (java.security.GeneralSecurityException)3 ASN1Integer (org.bouncycastle.asn1.ASN1Integer)3 CRLDistPoint (org.bouncycastle.asn1.x509.CRLDistPoint)3 DistributionPoint (org.bouncycastle.asn1.x509.DistributionPoint)3 ASN1IA5String (com.github.zhenwei.core.asn1.ASN1IA5String)2 ASN1OctetString (com.github.zhenwei.core.asn1.ASN1OctetString)2 ASN1Sequence (com.github.zhenwei.core.asn1.ASN1Sequence)2 CRLDistPoint (com.github.zhenwei.core.asn1.x509.CRLDistPoint)2 DistributionPoint (com.github.zhenwei.core.asn1.x509.DistributionPoint)2 GeneralSubtree (com.github.zhenwei.core.asn1.x509.GeneralSubtree)2