Sha256: 4ccb57e300fc3f533df3b344cd87b4dcb9419800f9ef53c490061cb7cd4d8e7f

Contents?: true

Size: 370 Bytes

Versions: 2

Compression:

Stored size: 370 Bytes

Contents

module RASN1
  module Types

    # ASN.1 UTF8 String
    # @author Sylvain Daubert
    class Utf8String < OctetString
      TAG = 12

      private
      
      def value_to_der
        @value.to_s.force_encoding('UTF-8').force_encoding('BINARY')
      end

      def der_to_value(der, ber:false)
        @value = der.force_encoding('UTF-8')
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rasn1-0.2.0 lib/rasn1/types/utf8_string.rb
rasn1-0.1.0 lib/rasn1/types/utf8_string.rb