Project

General

Profile

Actions

Feature #4412

closed

[ext/openssl] Create Digest by OID

Added by MartinBosslet (Martin Bosslet) almost 14 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
[ruby-core:35319]

Description

=begin
Currently it is not possible to create a Digest instance by using
the OID instead of the name (sn or ln).

oid = OpenSSL::ASN1::ObjectId.new('SHA1')
digest = OpenSSL::ASN1::Digest.new(oid.oid)

=> Unsupported digest algorithm (1.3.14.3.2.26).

This is counter-intuitive, since the only thing that is always
available in the case of object identifiers is the numeric oid,
sn or ln are not always present. Since sn and ln are also quite
error-prone (spelling), I'd like to suggest to have all three possibilities
for instantiating a Digest: by sn, by ln and by oid.

I included a patch and a test to support this behaviour.

Regards,
Martin
=end


Files

digest_by_oid.diff (1.67 KB) digest_by_oid.diff MartinBosslet (Martin Bosslet), 02/21/2011 01:45 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0