diff options
Diffstat (limited to 'lib/asn1kit/types/octet_string.rb')
-rw-r--r-- | lib/asn1kit/types/octet_string.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/asn1kit/types/octet_string.rb b/lib/asn1kit/types/octet_string.rb new file mode 100644 index 0000000..1b8a89e --- /dev/null +++ b/lib/asn1kit/types/octet_string.rb @@ -0,0 +1,21 @@ +# coding: ASCII-8BIT + +class ASN1Kit::OctetString < ASN1Kit::Type + asn1_tag :IMPLICIT, :UNIVERSAL, 4 + asn1_alias "OCTET STRING" + + attr_reader :value + + def initialize(value) + @value = value + end + + def to_der + der_header(@value.bytesize) << @value + end + + def ==(other) + return false unless other.is_a?(ASN1Kit::OctetString) + value == other.value + end +end |