use of org.apache.harmony.security.x501.AttributeTypeAndValue in project open-ecard by ecsec.
the class ListCertificates method matchesRdn.
private boolean matchesRdn(Pattern searchPattern, X500Name name, ASN1ObjectIdentifier rdnIdentifier) {
RDN[] rdns = name.getRDNs(rdnIdentifier);
if (rdns.length >= 1) {
// only compare first as everything else would be non standard in X509 certs
AttributeTypeAndValue rdnAttr = rdns[0].getFirst();
ASN1String attrStr = (ASN1String) rdnAttr.getValue().toASN1Primitive();
String rdnStr = attrStr.getString();
return searchPattern.matcher(rdnStr).matches();
} else {
return false;
}
}
Aggregations