Class: Binenc::Java::ASN1String

Inherits:
Object
  • Object
show all
Includes:
ASN1Object
Defined in:
lib/binenc/asn1_engine/object/string.rb

Instance Attribute Summary

Attributes included from ASN1Object

#value

Instance Method Summary collapse

Methods included from ASN1Object

decode, #initialize

Methods included from DataConversion

#from_b64, #from_hex, included, #to_b64, #to_b64_mime, #to_bin, #to_hex, #to_java_bytes, #to_str

Instance Method Details

#encoded(binary = true) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/binenc/asn1_engine/object/string.rb', line 9

def encoded(binary = true)
  obj = org.bouncycastle.asn1.DERUTF8String.new(@value.to_s)
  if binary
    obj.encoded
  else
    obj
  end
end

#is_equal?(val) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/binenc/asn1_engine/object/string.rb', line 18

def is_equal?(val)
  @value.bytes == val.bytes
end