ruby / ruby/openssl

Feature request: OpenSSL::PKey::RSA#size

Open
#5 14 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C
Stars
276
Forks
200
Avg merge
1d 19h
Merged PRs (30d)
7

Description

It would be nice to be able to introspect on the sizes of RSA keys:

pry(main)> key.size
NoMethodError: undefined method `size' for #<OpenSSL::PKey::RSA:0x007fa4292cafe0>

Here is an ugly way to implement it in pure Ruby using the existing API:

Integer(key.to_text[/\((\d+) bit/, 1], 10)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the OpenSSL::PKey::RSA implementation and the existing API used for key introspection. Check how RSA key operations are exposed and where related tests live. Done means RSA keys expose their key size through size, with coverage for the requested behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, ruby
Domain
cryptography
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.