Class: RASN1::Types::OctetString
- Defined in:
- lib/rasn1/types/octet_string.rb
Overview
Direct Known Subclasses
BmpString, IA5String, NumericString, PrintableString, UniversalString, Utf8String
Constant Summary collapse
- ID =
OctetString id value
4
Constants inherited from Primitive
Constants inherited from Base
Base::CLASSES, Base::CLASS_MASK, Base::INDEFINITE_LENGTH, Base::MULTI_OCTETS_ID
Instance Attribute Summary
Attributes inherited from Base
#asn1_class, #default, #name, #options
Instance Method Summary collapse
-
#der_to_value(der, ber: false) ⇒ void
Make string value from
der
string. - #inspect(level = 0) ⇒ String
Methods inherited from Base
#==, #can_build?, constrained?, #constructed?, #do_parse, #do_parse_explicit, #do_parse_explicit_with_tracing, #do_parse_with_tracing, encoded_type, #explicit?, #id, #implicit?, #initialize, #initialize_copy, #optional?, parse, #parse!, #primitive?, #specific_initializer, start_tracing, stop_tracing, #tagged?, #to_der, #trace, #type, type, #value, #value=, #value?, #value_size, #void_value
Constructor Details
This class inherits a constructor from RASN1::Types::Base
Instance Method Details
#der_to_value(der, ber: false) ⇒ void
This method returns an undefined value.
Make string value from der
string. Force encoding to UTF-8
30 31 32 33 34 35 36 37 |
# File 'lib/rasn1/types/octet_string.rb', line 30 def der_to_value(der, ber: false) klass = self.class if klass.const_defined?(:ENCODING) @value = der.to_s.dup.force_encoding(klass.const_get(:ENCODING)) else super end end |
#inspect(level = 0) ⇒ String
20 21 22 23 |
# File 'lib/rasn1/types/octet_string.rb', line 20 def inspect(level=0) str = common_inspect(level) str << " #{value.inspect}" end |