Can somebody advise me what this code does and how can I convert it to Ruby in most simple way?
#!perl
use Convert::ASN1;
my $asn1 = Convert::ASN1->new(encoding => 'DER');
$asn1->prepare(q<
Algorithm ::= SEQUENCE {
oid OBJECT IDENTIFIER,
opt ANY OPTIONAL
}
Signature ::= SEQUENCE {
alg Algorithm,
sig BIT STRING
}
>);
my $data = $asn1->encode(sig => $body,
alg => {oid => sha512WithRSAEncryption()});
It's a piece of a mexumgen, Perl library which sign update.rdf for Mozilla products with openssl.