Example usage for org.bouncycastle.asn1.x509 X509Name equals

List of usage examples for org.bouncycastle.asn1.x509 X509Name equals

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.x509 X509Name equals.

Prototype

public boolean equals(Object obj, boolean inOrder) 

Source Link

Usage

From source file:fi.laverca.Pkcs7.java

License:Apache License

/** 
 * Return true if two Distinguished Names are equal, ignoring 
 * delimiters and order of elements.// w  ww .j a v  a 2s  .  com
 * 
 * @param dn1 First Distinguished name
 * @param dn2 Second Distinguished name
 * @return true if DNs are equal, false otherwise
 */
@SuppressWarnings("deprecation")
public static boolean dnsEqual(String dn1, String dn2) {
    if (dn1 == null || dn2 == null) {
        return false;
    }

    X509Name n1 = new X509Name(dn1);
    X509Name n2 = new X509Name(dn2);

    return n1.equals(n2, false);
}