Sha256: 0867a9fd34477fc0fd61e4eec6e976db6a582eb533cdf9b5f131023e4cd441e5

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 Bytes

Contents

# frozen_string_literal: true

require "openssl"
require "openssl/signature_algorithm/base"

module OpenSSL
  module SignatureAlgorithm
    class RSAPKCS1 < Base
      class SigningKey < OpenSSL::PKey::RSA
        def verify_key
          VerifyKey.new(public_key.to_pem)
        end
      end

      class VerifyKey < OpenSSL::PKey::RSA
        class << self
          alias_method :deserialize, :new
        end

        def serialize
          to_pem
        end
      end

      DEFAULT_KEY_SIZE = 2048

      def generate_signing_key(size: DEFAULT_KEY_SIZE)
        @signing_key = SigningKey.new(size)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openssl-signature_algorithm-0.4.0 lib/openssl/signature_algorithm/rsapkcs1.rb