Class: RASN1::Types::BitString
- Defined in:
- lib/rasn1/types/bit_string.rb
Overview
ASN.1 Bit String
Constant Summary collapse
- TAG =
0x03
Constants inherited from Primitive
Constants inherited from Base
RASN1::Types::Base::CLASSES, RASN1::Types::Base::INDEFINITE_LENGTH, RASN1::Types::Base::MAX_TAG
Instance Attribute Summary collapse
-
#bit_length ⇒ Integer
Bit length of bit string.
Attributes inherited from Base
#asn1_class, #default, #name, #value
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ BitString
constructor
A new instance of BitString.
Methods inherited from Base
#constructed?, #explicit?, #implicit?, #initialize_copy, #optional?, #parse!, #primitive?, #tag, #tagged?, #to_der, type, #type, #value_size
Constructor Details
#initialize(name, options = {}) ⇒ BitString
Returns a new instance of BitString.
20 21 22 23 24 25 26 27 28 |
# File 'lib/rasn1/types/bit_string.rb', line 20 def initialize(name, ={}) super if @default if [:bit_length].nil? raise ASN1Error, "TAG #@name: default bit length is not defined" end @default_bit_length = [:bit_length] end end |
Instance Attribute Details
#bit_length ⇒ Integer
Returns bit length of bit string.
10 11 12 |
# File 'lib/rasn1/types/bit_string.rb', line 10 def bit_length @bit_length end |