Class: Binenc::Java::ASN1Binary

Inherits:
Object
  • Object
show all
Includes:
ASN1Object
Defined in:
lib/binenc/asn1_engine/object/binary.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
17
# File 'lib/binenc/asn1_engine/object/binary.rb', line 9

def encoded(binary = true)
  obj = org.bouncycastle.asn1.DERBitString.new(to_java_bytes(@value))

  if binary
    obj.encoded
  else
    obj
  end
end

#is_equal?(val) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/binenc/asn1_engine/object/binary.rb', line 19

def is_equal?(val)
  @value == to_java_bytes(val)
end