Skip to content

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

@tarcieri

Description

@tarcieri

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions