{"record":{"id":"a62aaf25b3ec8e65","repo":"ruby/rubygems","slug":"algorithm-algorithm-not-found-rsa-dsa-and-ec","errorCode":null,"errorMessage":"#{algorithm} algorithm not found. RSA, DSA, and EC algorithms are supported.","messagePattern":"#(.+?) algorithm not found\\. RSA, DSA, and EC algorithms are supported\\.","errorType":"exception","errorClass":"Gem::Security::Exception","httpStatus":null,"severity":"error","filePath":"lib/rubygems/security.rb","lineNumber":480,"sourceCode":"  def self.create_digest(algorithm = DIGEST_NAME)\n    OpenSSL::Digest.new(algorithm)\n  end\n\n  ##\n  # Creates a new key pair of the specified +algorithm+. RSA, DSA, and EC\n  # are supported.\n\n  def self.create_key(algorithm)\n    if defined?(OpenSSL::PKey)\n      case algorithm.downcase\n      when \"dsa\"\n        OpenSSL::PKey::DSA.new(RSA_DSA_KEY_LENGTH)\n      when \"rsa\"\n        OpenSSL::PKey::RSA.new(RSA_DSA_KEY_LENGTH)\n      when \"ec\"\n        OpenSSL::PKey::EC.generate(EC_NAME)\n      else\n        raise Gem::Security::Exception,\n        \"#{algorithm} algorithm not found. RSA, DSA, and EC algorithms are supported.\"\n      end\n    end\n  end\n\n  ##\n  # Turns +email_address+ into an OpenSSL::X509::Name\n\n  def self.email_to_name(email_address)\n    email_address = email_address.gsub(/[^\\w@.-]+/i, \"_\")\n\n    cn, dcs = email_address.split \"@\"\n\n    dcs = dcs.split \".\"\n\n    OpenSSL::X509::Name.new([\n      [\"CN\", cn],\n      *dcs.map {|dc| [\"DC\", dc] },","sourceCodeStart":462,"sourceCodeEnd":498,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/security.rb#L462-L498","documentation":"Error \"#{algorithm} algorithm not found. RSA, DSA, and EC algorithms are supported.\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/security.rb:480 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an RSA, DSA, or EC key for signing; the reported algorithm is unsupported"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86cbb817a38ce8477b181c17467a703ded3f2be8","analyzedAt":"2026-08-23T06:27:48.159Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}