Skip to content

Add a method OpenSSL::PKey#size #988

@herwinw

Description

@herwinw

I was trying to migrate an old Perl script to Ruby, which receives a string consisting of a signature and the contents concatenated. The core of the script is like this:

my $sign_key = Crypt::OpenSSL::RSA->new_public_key($key_string);
my $signature = substr($data, 0, $sign_key->size, ''); # Cut off signature of $data
die "data wasn't signed correctly!\n" unless $sign_key->verify($data, $signature);

There does not appear a way to get the size of the signature from Ruby. It should just be a call to EVP_PKEY_get_size

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions