Example usage for org.bouncycastle.asn1.ocsp CertID getIssuerNameHash

List of usage examples for org.bouncycastle.asn1.ocsp CertID getIssuerNameHash

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.ocsp CertID getIssuerNameHash.

Prototype

public ASN1OctetString getIssuerNameHash() 

Source Link

Usage

From source file:org.jruby.ext.openssl.OCSPCertificateId.java

License:Common Public License

@JRubyMethod(name = "cmp_issuer")
public IRubyObject cmp_issuer(IRubyObject other) {
    Ruby runtime = getRuntime();//w  ww  .  ja  v a  2s .c  o  m
    if (equals(other)) {
        return RubyFixnum.zero(runtime);
    }
    if (other instanceof OCSPCertificateId) {
        OCSPCertificateId that = (OCSPCertificateId) other;
        CertID thisCert = this.getCertID();
        CertID thatCert = that.getCertID();
        int ret = thisCert.getHashAlgorithm().getAlgorithm().toString()
                .compareTo(thatCert.getHashAlgorithm().getAlgorithm().toString());
        if (ret != 0)
            return RubyFixnum.newFixnum(runtime, ret);
        ret = thisCert.getIssuerNameHash().toString().compareTo(thatCert.getIssuerNameHash().toString());
        if (ret != 0)
            return RubyFixnum.newFixnum(runtime, ret);
        return RubyFixnum.newFixnum(runtime,
                thisCert.getIssuerKeyHash().toString().compareTo(thatCert.getIssuerKeyHash().toString()));
    } else {
        return runtime.getCurrentContext().nil;
    }
}