Closed GabrieleCocco closed 8 years ago
openssl rsautl
by default expects the -inkey
parameter to be in PEM in format, but MIHRSAPublicKey#dataValue method returns the public key in DER format. You can use DER formatted keys with openssl rsautl
by setting -keyform
parameter to DER
I managed to use PEM anyway by manually (re)adding the header stripped in dataValue function. Seems to work ok in .NET as well. Thanks.
Sorry, for not supporting multiple formats with dataValue
. I'm aware that dataValue
is small miss-design in the library, that's why there is already a draft for a different way to export keys by defining a data format - however yet, I didn't find time to implement it - see #9 for more details.
Hi, i gotta say this is the only library I found in months or research that allows to -easily- handle keys, signature and encryption in iOS: great job! I'm using it to sign data that must be sent (signed) together with public key to a cloud service for authentication. Unfortunately, I'm having troubles "exporting" the public key in a format that can be used by .NET. As a matter of fact, I also tried to copy+paste the signed data and the result of calling dataValue on the public key to a file and then use command line openssl verify:
openssl rsautl -verify -inkey ~/Desktop/pubkey.pem -in ~/Desktop/datasigned.txt -pubin -raw -hexdump
Resulting in: unable to load Public Key I guess what is missing is the algorithm OID, which would be useful.
Did you test the dataValue result agains out-of-project signature verification tools? Thanks!