Can I use .NET generated keys with Crypto++?

5 views
Skip to first unread message

Christo

unread,
May 27, 2009, 12:11:27 PM5/27/09
to Crypto++ Users
Hi

I've generated public/private keys using .NET's
RSACryptoServiceProvider. Can I use these keys with Crypto++?

The format of the file I get is:

<RSAKeyValue><Modulus>1P0s5dpoDz5m8ew7+ndyJEtxP7Ohf/
0H2FJ25PlSLW8xH6vP4ztUnC1heT8aGTUZIpRLpg5M6+kVfsuaWhfA8Q==</
Modulus><Exponent>AQAB</Exponent><P>6d76ywBYnLaHAQy5Fvt0Hz/
Z3CisOk29OSuTYKpQEz0=</P><Q>6SRfigFlwnJVbBMW8dkY4/JOWmPLhGJkQqyaY8a/
78U=</Q><DP>bQPgmcH2jE5VDfs1R+48idiEoChhZ+gW3VBfqX6aRu0=</
DP><DQ>ebaZggy0uUzDN8bHhb8W9Xm8WggbaaOMQBqoB0rtTRk=</
DQ><InverseQ>A4FLkHnTd9ROgyBbl8sG36ubCmIPCIx/1ywjZgsbOFo=</
InverseQ><D>leiIJFOf8DK8pEPgRz6w8MjEsdBNuFawodoQ4sJ0y5Jxrb7PnUulOn/dK
+FXpxojLu/zvenQvFSVWcc3muefEQ==</D></RSAKeyValue>

Any ideas?
Christo

Jeffrey Walton

unread,
May 27, 2009, 8:17:56 PM5/27/09
to Christo, Crypto++ Users
> I've generated public/private keys using .NET's
> RSACryptoServiceProvider. Can I use these keys with Crypto++?
No. You need to save them in PKCS #8 format.

> <RSAKeyValue><Modulus>1P0s5dpoDz5m8ew7+ndyJEtxP7Ohf/
> 0H2FJ25PlSLW8xH6vP4ztUnC1heT8aGTUZIpRLpg5M6+kVfsuaWhfA8Q==</
> Modulus><Exponent>AQAB</Exponent><P>6d76ywBYnLaHAQy5Fvt0Hz/
> Z3CisOk29OSuTYKpQEz0=</P><Q>6SRfigFlwnJVbBMW8dkY4/JOWmPLhGJkQqyaY8a/
> 78U=</Q><DP>bQPgmcH2jE5VDfs1R+48idiEoChhZ+gW3VBfqX6aRu0=</
> DP><DQ>ebaZggy0uUzDN8bHhb8W9Xm8WggbaaOMQBqoB0rtTRk=</
> DQ><InverseQ>A4FLkHnTd9ROgyBbl8sG36ubCmIPCIx/1ywjZgsbOFo=</
> InverseQ><D>leiIJFOf8DK8pEPgRz6w8MjEsdBNuFawodoQ4sJ0y5Jxrb7PnUulOn/dK
> +FXpxojLu/zvenQvFSVWcc3muefEQ==</D></RSAKeyValue>

Oops... Posting of private keys is frowned upon :)

Jeff

Christo

unread,
May 29, 2009, 3:26:17 AM5/29/09
to Crypto++ Users
> No. You need to save them in PKCS #8 format.
Yes, it seems that that is a way to do it.

I've also asked the question on stackoverflow and got another useful
answer there.
http://stackoverflow.com/questions/919733/can-i-use-rsacryptoserviceprovider-public-private-keys-to-interop-with-crypto.

> Oops... Posting of private keys is frowned upon :)
I just through it in there to grab someone's attention... Luckily I'm
not using it for any critical data ;-).

On May 28, 2:17 am, Jeffrey Walton <noloa...@gmail.com> wrote:
> > I've generated public/private keys using .NET's
> > RSACryptoServiceProvider. Can I use these keys with Crypto++?
>
> No. You need to save them in PKCS #8 format.
>
> > <RSAKeyValue><Modulus>1P0s5dpoDz5m8ew7+ndyJEtxP7Ohf/
> > 0H2FJ25PlSLW8xH6vP4ztUnC1heT8aGTUZIpRLpg5M6+kVfsuaWhfA8Q==</
> > Modulus><Exponent>AQAB</Exponent><P>6d76ywBYnLaHAQy5Fvt0Hz/
> > Z3CisOk29OSuTYKpQEz0=</P><Q>6SRfigFlwnJVbBMW8dkY4/JOWmPLhGJkQqyaY8a/
> > 78U=</Q><DP>bQPgmcH2jE5VDfs1R+48idiEoChhZ+gW3VBfqX6aRu0=</
> > DP><DQ>ebaZggy0uUzDN8bHhb8W9Xm8WggbaaOMQBqoB0rtTRk=</
> > DQ><InverseQ>A4FLkHnTd9ROgyBbl8sG36ubCmIPCIx/1ywjZgsbOFo=</
> > InverseQ><D>leiIJFOf8DK8pEPgRz6w8MjEsdBNuFawodoQ4sJ0y5Jxrb7PnUulOn/dK
> > +FXpxojLu/zvenQvFSVWcc3muefEQ==</D></RSAKeyValue>
>
> Oops... Posting of private keys is frowned upon :)
>
> Jeff
>
Reply all
Reply to author
Forward
0 new messages