Update for ObjectDescriptor and ASN1BitString
import java.io.IOException;
import org.bouncycastle.asn1.ASN1ApplicationSpecific;
+import org.bouncycastle.asn1.ASN1BitString;
import org.bouncycastle.asn1.ASN1Boolean;
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1Enumerated;
import org.bouncycastle.asn1.ASN1GeneralizedTime;
import org.bouncycastle.asn1.ASN1Integer;
import org.bouncycastle.asn1.ASN1Null;
+import org.bouncycastle.asn1.ASN1ObjectDescriptor;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.BERTags;
import org.bouncycastle.asn1.DERApplicationSpecific;
import org.bouncycastle.asn1.DERBMPString;
-import org.bouncycastle.asn1.DERBitString;
import org.bouncycastle.asn1.DERGraphicString;
import org.bouncycastle.asn1.DERIA5String;
import org.bouncycastle.asn1.DERPrintableString;
@@ -190,13 +191,14 @@ else if (obj instanceof ASN1Integer)
{
buf.append(indent + "Integer(" + ((ASN1Integer)obj).getValue() + ")" + nl);
}
- else if (obj instanceof DERBitString)
+ else if (obj instanceof ASN1BitString)
{
- DERBitString bt = (DERBitString)obj;
- buf.append(indent + "DER Bit String" + "[" + bt.getBytes().length + ", " + bt.getPadBits() + "] ");
+ ASN1BitString bt = (ASN1BitString)obj;
+ byte[] bytes = bt.getBytes();
+ buf.append(indent + "DER Bit String" + "[" + bytes.length + ", " + bt.getPadBits() + "] ");
if (verbose)
{
- buf.append(dumpBinaryDataAsString(indent, bt.getBytes()));
+ buf.append(dumpBinaryDataAsString(indent, bytes));
}
else
{
@@ -248,6 +250,11 @@ else if (obj instanceof ASN1Enumerated)
ASN1Enumerated en = (ASN1Enumerated) obj;
buf.append(indent + "DER Enumerated(" + en.getValue() + ")" + nl);
}
+ else if (obj instanceof ASN1ObjectDescriptor)
+ {
+ ASN1ObjectDescriptor od = (ASN1ObjectDescriptor)obj;
+ buf.append(indent + "ObjectDescriptor(" + od.getBaseGraphicString().getString() + ") " + nl);
+ }
else if (obj instanceof ASN1External)
{
ASN1External ext = (ASN1External) obj;
