Yves Vogl
1/26/2009 10:22:00 AM
Hi,
On 25.01.2009, at 20:12, Sandor Sz=FCcs wrote:
> I think what you want is:
> p7 =3D OpenSSL::PKCS7::PKCS7.new(signed)
>
> The variable signed is the signature in your example and is of type =20=
> OpenSSL::PKCS7.
But isn't this redundant then?
signed =3D OpenSSL::PKCS7::sign(crt, key, data, [], =20
OpenSSL::PKCS7::DETACHED)
At this point I have a complete p7s file already (see signed.inspect)
When adding certificate and data again, I'm signing a signature=85
p7 =3D OpenSSL::PKCS7::PKCS7.new(signed)
p7.add_certificate(crt)
p7.add_data(data)
At least my signature is as big as the input file then=85 no matter if I =
=20
say "DETACHED" or "BINARY" in the example above.
>
> Try OpenSSL::Digest::SHA512.new, Digest is not the same as =20
> Openssl::Digest.
> irb> Digest.class
> =3D> Module
> irb> OpenSSL::Digest.class
> =3D> Class
>> Digest.class
NameError: uninitialized constant Digest
from (irb):11
>> OpenSSL::Digest.class
=3D> Module
irb 0.9.5(05/04/13)
ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]
Mac OS X 10.5.6, Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST =20=
2008; root:xnu-1228.9.59~1/RELEASE_I386
Cheers, Yves