Sha256: 716928d2c4923cd7e81eb806cd4971c7ec82200d54969c6fb190cbd0e34388b7
Contents?: true
Size: 888 Bytes
Versions: 12
Compression:
Stored size: 888 Bytes
Contents
module SignKeyFixtureHelper def shared_secret 'shared-secret' end def pem_file(file_name) File.new( File.join( File.dirname(__FILE__), "../fixtures/#{file_name}.pem" ) ) end def private_key(algorithm = :rsa, options = {}) case algorithm when :rsa OpenSSL::PKey::RSA.new( pem_file("#{algorithm}/private_key"), 'pass-phrase' ) when :ecdsa OpenSSL::PKey::EC.new( pem_file("#{algorithm}/#{options[:digest_length]}/private_key") ) end end def public_key(algorithm = :rsa, options = {}) case algorithm when :rsa OpenSSL::PKey::RSA.new( pem_file("#{algorithm}/public_key") ) when :ecdsa OpenSSL::PKey::EC.new( pem_file("#{algorithm}/#{options[:digest_length]}/public_key") ) end end end include SignKeyFixtureHelper
Version data entries
12 entries across 12 versions & 1 rubygems