Hi Chan,
I ran Wei's Rabi1024.dat file through a hex decoder and saved as binary.
FileSource( "Rabi1024.dat", true,
new HexDecoder(
new FileSink( "Rabin.key", true )
)
);
I then opened it with ObjectiveSystem's ASN.1 View. It appears that is
a DER encoded file. There are 6 integers laid out end to end. No OIDs,
no subjectPublicKeyInfo or PrivateKeyInfo. So we must use BERDecode()
to load the key. But it must be done through AccessKey(). So try this:
RabinSS<PSSR, SHA1>::Signer signer;
signer.AccessKey().BERDecode(...);
I can't explain why Signer.AccessPrivateKey().BERDecode(...) and the
like does not work, and why it does not work on the
InvertibleRabinFunction.
Jeff
On 3/20/09, Jeffrey Walton <[email protected]> wrote:
> Hi Chan,
>
> I would expect the following to be the most straight forward way to do
> this. But it does not work.
>
> InvertibleRabinFunction params;
> params.GenerateRandomWithKeySize(rng, keylength);
>
> Rabin::PrivateKey prv( params );
> Rabin::PublicKey pub( params );
>
> prv.Save( HexEncoder( new FileSink( "private.bin", false ) ) );
> pub.Save( HexEncoder( new FileSink( "public.bin", false ) ) );
>
> I also looked at Rabi1024.dat. It is a hex encoded ASN.1 object (it
> starts with 3082015202818100D1... ). I would be surprised if it was
> not generated from Crypto++.
>
> I don't know what Wei's motivation was for stripping out the
> X509PublicKey and PKCS8PrivateKey form the Rabin gear. Perhaps Wei can
> help out here.
>
> Jeff
>
>
> [SNIP]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---