@@ -963,8 +963,8 @@ static IRubyObject decodeObject(final ThreadContext context,
963
963
return ASN1 .getClass ("Integer" ).newInstance (context , val , Block .NULL_BLOCK );
964
964
}
965
965
966
- if ( obj instanceof DERBitString ) {
967
- final DERBitString derObj = (DERBitString ) obj ;
966
+ if ( obj instanceof ASN1BitString ) {
967
+ final ASN1BitString derObj = (ASN1BitString ) obj ;
968
968
RubyString str = runtime .newString ( new ByteList (derObj .getBytes (), false ) );
969
969
IRubyObject bitString = ASN1 .getClass ("BitString" ).newInstance (context , str , Block .NULL_BLOCK );
970
970
bitString .callMethod (context , "unused_bits=" , runtime .newFixnum ( derObj .getPadBits () ));
@@ -974,31 +974,31 @@ static IRubyObject decodeObject(final ThreadContext context,
974
974
final Integer typeId = typeId ( obj .getClass () );
975
975
String type = typeId == null ? null : (String ) ( ASN1_INFO [typeId ][2 ] );
976
976
final ByteList bytes ;
977
- if ( obj instanceof DERUTF8String ) {
977
+ if ( obj instanceof ASN1UTF8String ) {
978
978
if ( type == null ) type = "UTF8String" ;
979
- bytes = new ByteList (((DERUTF8String ) obj ).getString ().getBytes ("UTF-8" ), false );
979
+ bytes = new ByteList (((ASN1UTF8String ) obj ).getString ().getBytes ("UTF-8" ), false );
980
980
}
981
981
else {
982
982
if ( type == null ) {
983
- if ( obj instanceof DERNumericString ) {
983
+ if ( obj instanceof ASN1NumericString ) {
984
984
type = "NumericString" ;
985
985
}
986
- else if ( obj instanceof DERPrintableString ) {
986
+ else if ( obj instanceof ASN1PrintableString ) {
987
987
type = "PrintableString" ;
988
988
}
989
- else if ( obj instanceof DERIA5String ) {
989
+ else if ( obj instanceof ASN1IA5String ) {
990
990
type = "IA5String" ;
991
991
}
992
- else if ( obj instanceof DERT61String ) {
992
+ else if ( obj instanceof ASN1T61String ) {
993
993
type = "T61String" ;
994
994
}
995
- else if ( obj instanceof DERGeneralString ) {
995
+ else if ( obj instanceof ASN1GeneralString ) {
996
996
type = "GeneralString" ;
997
997
}
998
- else if ( obj instanceof DERUniversalString ) {
998
+ else if ( obj instanceof ASN1UniversalString ) {
999
999
type = "UniversalString" ;
1000
1000
}
1001
- else if ( obj instanceof DERBMPString ) {
1001
+ else if ( obj instanceof ASN1BMPString ) {
1002
1002
type = "BMPString" ;
1003
1003
}
1004
1004
else {
@@ -1011,11 +1011,6 @@ else if ( obj instanceof DERBMPString ) {
1011
1011
return ASN1 .getClass (type ).newInstance (context , runtime .newString (bytes ), Block .NULL_BLOCK );
1012
1012
}
1013
1013
1014
- //if ( obj instanceof DEROctetString ) {
1015
- // byte[] octets = ((ASN1OctetString) obj).getOctets();
1016
- // if ( (octets[0] & 0xFF) == 0xD1 ) Thread.dumpStack();
1017
- //}
1018
-
1019
1014
if ( obj instanceof ASN1OctetString ) {
1020
1015
final ByteList octets = new ByteList (((ASN1OctetString ) obj ).getOctets (), false );
1021
1016
// NOTE: sometimes MRI does include the tag but it really should not ;( !
0 commit comments