Home All Groups Group Topic Archive Search About

Exporting public key from RSACryptoServiceProvider in ASN.1 format

Author
29 Dec 2006 11:22 AM
Debbie Croft
Is it possible to export the public key generated by
RSACryptoServiceProvider in ASN.1 format? I need to decrypt using other
"frameworks" (e.g. Delphi using LockBox). I only need to do this with the
public key - the private one will only be used by .NET applications.

I'm encrypting a small serial number in one application (the .NET app) and
them having it decypted by remote applications.(multiple
platforms/frameworks).

If it's possible to export RSACryptoServiceProvider public keys as ASN.1,
how would I go about doing it?

Author
30 Dec 2006 1:40 PM
Valery Pryamikov
Debbie Croft wrote:
> Is it possible to export the public key generated by
> RSACryptoServiceProvider in ASN.1 format? I need to decrypt using other
> "frameworks" (e.g. Delphi using LockBox). I only need to do this with the
> public key - the private one will only be used by .NET applications.
>
> I'm encrypting a small serial number in one application (the .NET app) and
> them having it decypted by remote applications.(multiple
> platforms/frameworks).
>
> If it's possible to export RSACryptoServiceProvider public keys as ASN.1,
> how would I go about doing it?

CryptExportKey(..., PUBLICKEYBLOB...) is exporting public key in ASN.1
format.
With RSACryptoServiceProvider you should be able to use ExportCspBlob
(which is actually calling CryptExportKey).

Was that what you were looking for?

-Valery.
http://www.harper.no/valery
Author
2 Jan 2007 10:59 AM
Debbie Croft
Yes, quite possibly. I'll try this out and see if it solves my problem.

Show quoteHide quote
"Valery Pryamikov" <val***@harper.no> wrote in message
news:1167486048.071515.216640@n51g2000cwc.googlegroups.com...
> Debbie Croft wrote:
>> Is it possible to export the public key generated by
>> RSACryptoServiceProvider in ASN.1 format? I need to decrypt using other
>> "frameworks" (e.g. Delphi using LockBox). I only need to do this with the
>> public key - the private one will only be used by .NET applications.
>>
>> I'm encrypting a small serial number in one application (the .NET app)
>> and
>> them having it decypted by remote applications.(multiple
>> platforms/frameworks).
>>
>> If it's possible to export RSACryptoServiceProvider public keys as ASN.1,
>> how would I go about doing it?
>
> CryptExportKey(..., PUBLICKEYBLOB...) is exporting public key in ASN.1
> format.
> With RSACryptoServiceProvider you should be able to use ExportCspBlob
> (which is actually calling CryptExportKey).
>
> Was that what you were looking for?
>
> -Valery.
> http://www.harper.no/valery
>