Sha256: ec1c1474c830b48098edce7f670a05fdef2176cdb7be491af78eb1610b9c60de

Contents?: true

Size: 497 Bytes

Versions: 5

Compression:

Stored size: 497 Bytes

Contents

module RASN1
  module Types

    # ASN.1 IA5 String
    # @author Sylvain Daubert
    class IA5String < OctetString
      TAG = 22

      # Get ASN.1 type
      # @return [String]
      def self.type
        self.to_s.gsub(/.*::/, '')
      end

      private
      
      def value_to_der
        @value.to_s.force_encoding('US-ASCII').force_encoding('BINARY')
      end

      def der_to_value(der, ber:false)
        super
        @value.force_encoding('US-ASCII')
      end
     end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rasn1-0.6.0 lib/rasn1/types/ia5string.rb
rasn1-0.5.0 lib/rasn1/types/ia5string.rb
rasn1-0.4.0 lib/rasn1/types/ia5string.rb
rasn1-0.3.1 lib/rasn1/types/ia5string.rb
rasn1-0.3.0 lib/rasn1/types/ia5string.rb