Sha256: 3f0331ff3b6d595032c635f098f5043da248f836082afdadb224c3ef83399748

Contents?: true

Size: 522 Bytes

Versions: 4

Compression:

Stored size: 522 Bytes

Contents

# frozen_string_literal: true

module RASN1
  module Types
    # ASN.1 IA5 String
    # @author Sylvain Daubert
    class IA5String < OctetString
      # IA5String id value
      ID = 22

      # Get ASN.1 type
      # @return [String]
      def self.type
        'IA5String'
      end

      private

      def value_to_der
        @value.to_s.dup.force_encoding('US-ASCII').b
      end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rasn1-0.13.1 lib/rasn1/types/ia5string.rb
rasn1-0.13.0 lib/rasn1/types/ia5string.rb
rasn1-0.12.1 lib/rasn1/types/ia5string.rb
rasn1-0.12.0 lib/rasn1/types/ia5string.rb