Skip to content

Commit 589bcd0

Browse files
committed
Prefer ASN1*Strings over DER*Strings in ASN1.java
1 parent 491f1eb commit 589bcd0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/jruby/ext/openssl/ASN1.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,13 +1695,13 @@ ASN1Encodable toASN1(final ThreadContext context) {
16951695
}
16961696

16971697
if ( type == DERGeneralString.class ) {
1698-
return new DERGeneralString( val.asString().toString() );
1698+
return ASN1GeneralString.getInstance( val.asString().getBytes() );
16991699
}
17001700
if ( type == DERVisibleString.class ) {
1701-
return new DERVisibleString( val.asString().toString() );
1701+
return ASN1VisibleString.getInstance( val.asString().getBytes() );
17021702
}
17031703
if ( type == DERNumericString.class ) {
1704-
return new DERNumericString( val.asString().toString() );
1704+
return ASN1NumericString.getInstance( val.asString().getBytes() );
17051705
}
17061706

17071707
if ( val instanceof RubyString ) {

0 commit comments

Comments
 (0)