Example usage for org.bouncycastle.asn1 ASN1TaggedObject isExplicit

List of usage examples for org.bouncycastle.asn1 ASN1TaggedObject isExplicit

Introduction

In this page you can find the example usage for org.bouncycastle.asn1 ASN1TaggedObject isExplicit.

Prototype

public boolean isExplicit() 

Source Link

Document

return whether or not the object may be explicitly tagged.

Usage

From source file:net.sf.keystore_explorer.utilities.asn1.Asn1Dump.java

License:Open Source License

private String dumpTaggedObject(ASN1TaggedObject o) throws Asn1Exception, IOException {

    StringBuilder sb = new StringBuilder();

    sb.append(indentSequence.toString(indentLevel));
    if (o instanceof BERTaggedObject) {
        sb.append("BER TAGGED [");
    } else {//from   ww  w . j a  v a  2 s. c  om
        sb.append("TAGGED [");
    }
    sb.append(Integer.toString(o.getTagNo()));
    sb.append(']');

    if (!o.isExplicit()) {
        sb.append(" IMPLICIT ");
    }
    sb.append(":");
    sb.append(NEWLINE);

    if (o.isEmpty()) {
        sb.append("EMPTY");
    } else {
        sb.append(dump(o.getObject()));
    }

    return sb.toString();
}

From source file:org.glite.voms.ac.AttCertIssuer.java

License:eu-egee.org license

public AttCertIssuer(ASN1Encodable obj) throws IOException {
    if (obj instanceof ASN1TaggedObject) {
        ASN1TaggedObject cObj = (ASN1TaggedObject) obj;

        if (cObj.isExplicit() && (cObj.getTagNo() == 0)) {
            v2Form = new V2Form(ASN1Sequence.getInstance(cObj, /*explicit=*/
                    false));//ww  w  . ja v a 2  s.c  o  m
            version = 2;
        }
    } else if (obj instanceof ASN1Sequence) {
        v1Form = GeneralNames.getInstance((ASN1Sequence) obj);
        version = 1;
    }

    if (version < 0) {
        throw new IllegalArgumentException("AttCertIssuer: input not a proper CHOICE");
    }
}