|
39 | 39 | import org.bouncycastle.asn1.ASN1Encoding; |
40 | 40 | import org.bouncycastle.asn1.ASN1Integer; |
41 | 41 | import org.bouncycastle.asn1.ASN1IA5String; |
42 | | -import org.bouncycastle.asn1.ASN1Object; |
43 | 42 | import org.bouncycastle.asn1.ASN1ObjectIdentifier; |
44 | 43 | import org.bouncycastle.asn1.ASN1OctetString; |
45 | 44 | import org.bouncycastle.asn1.ASN1Primitive; |
|
62 | 61 | import org.jruby.Ruby; |
63 | 62 | import org.jruby.RubyArray; |
64 | 63 | import org.jruby.RubyClass; |
65 | | -import org.jruby.RubyHash; |
66 | 64 | import org.jruby.RubyModule; |
67 | 65 | import org.jruby.RubyNumeric; |
68 | 66 | import org.jruby.RubyObject; |
|
78 | 76 | import static org.jruby.ext.openssl.ASN1._ASN1; |
79 | 77 | import static org.jruby.ext.openssl.X509._X509; |
80 | 78 | import static org.jruby.ext.openssl.OpenSSL.*; |
81 | | -import static org.jruby.ext.openssl.StringHelper.*; |
82 | 79 |
|
83 | 80 | /** |
84 | 81 | * OpenSSL::X509::Extension |
@@ -846,44 +843,6 @@ public IRubyObject eql_p(IRubyObject obj) { |
846 | 843 | return equalImpl(getRuntime(), obj); |
847 | 844 | } |
848 | 845 |
|
849 | | - // [ self.oid, self.value, self.critical? ] |
850 | | - @JRubyMethod |
851 | | - public RubyArray to_a(final ThreadContext context) { |
852 | | - RubyArray array = RubyArray.newArray(context.runtime, 3); |
853 | | - array.append(oid(context)); |
854 | | - array.append(value(context)); |
855 | | - array.append(critical_p(context)); |
856 | | - return array; |
857 | | - } |
858 | | - |
859 | | - // {"oid"=>self.oid,"value"=>self.value,"critical"=>self.critical? |
860 | | - @JRubyMethod |
861 | | - public RubyHash to_h(final ThreadContext context) { |
862 | | - final Ruby runtime = context.runtime; |
863 | | - RubyHash hash = RubyHash.newHash(runtime); |
864 | | - hash.op_aset(context, newStringFrozen(runtime, "oid"), oid(context)); |
865 | | - hash.op_aset(context, newStringFrozen(runtime, "value"), value(context)); |
866 | | - hash.op_aset(context, newStringFrozen(runtime, "critical"), critical_p(context)); |
867 | | - return hash; |
868 | | - } |
869 | | - |
870 | | - // "oid = critical, value" |
871 | | - @JRubyMethod |
872 | | - public RubyString to_s(final ThreadContext context) { |
873 | | - final Ruby runtime = context.runtime; |
874 | | - final RubyString str = RubyString.newString(runtime, oidSym(runtime)); |
875 | | - str.getByteList().append(' ').append('=').append(' '); |
876 | | - if ( isRealCritical() ) str.getByteList().append(critical__); |
877 | | - // self.value.gsub(/\n/, ", ") |
878 | | - final RubyString value = value(context); |
879 | | - value.callMethod(context, "gsub!", new IRubyObject[] { |
880 | | - RubyString.newStringShared(runtime, StringHelper.NEW_LINE), |
881 | | - RubyString.newStringShared(runtime, StringHelper.COMMA_SPACE) |
882 | | - }); |
883 | | - str.getByteList().append(value.getByteList()); |
884 | | - return str; |
885 | | - } |
886 | | - |
887 | 846 | @Override |
888 | 847 | public X509Extension clone() { |
889 | 848 | try { |
|
0 commit comments