lib/openssl/signature_algorithm/ecdsa.rb
# Borrowed from jwt rubygem.
# https://github.com/jwt/ruby-jwt/blob/7a6a3f1dbaff806993156d1dff9c217bb2523ff8/lib/jwt/security_utils.rb#L34-L39
#
# Hopefully this will be provided by openssl rubygem in the future.
Borrowed from jwt rubygem.

Hopefully this will be provided by openssl rubygem in the future.
Borrowed from jwt rubygem . Hopefully this will be provided by openssl rubygem in the future .
def formatted_signature(signature)
        n = (verify_key_length.to_f / BYTE_LENGTH).ceil
        if signature.size == n * 2
          r = signature[0..(n - 1)]
          s = signature[n..-1]
          OpenSSL::ASN1::Sequence.new([r, s].map { |int| OpenSSL::ASN1::Integer.new(OpenSSL::BN.new(int, 2)) }).to_der
        else
          signature
        end
      end
def formatted_signature ( signature ) n = ( verify_key_length . to_f / BYTE_LENGTH ) . ceil if signature . size == n * 2 r = signature [ 0 .. ( n - 1 ) ] s = signature [ n .. - 1 ] OpenSSL :: ASN1 :: Sequence . new ( [ r , s ] . map { | int | OpenSSL :: ASN1 :: Integer . new ( OpenSSL :: BN . new ( int , 2 ) ) } ) . to_der else signature end end
Borrowed from jwt rubygem.
Borrowed from jwt rubygem .
signature
<not_specific>