Re: Suggested additional constructor for RSACryptoServiceProvider
From: Steven Grayson [MSFT] (sgrayson_at_online.microsoft.com)
Date: 06/12/03
- Next message: David Puplava: "Digest Authentication Help"
- Previous message: David: "Https postback"
- In reply to: Pieter Philippaerts: "Re: Suggested additional constructor for RSACryptoServiceProvider"
- Next in thread: Michel Gallant: "Re: Suggested additional constructor for RSACryptoServiceProvider"
- Reply: Michel Gallant: "Re: Suggested additional constructor for RSACryptoServiceProvider"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 12 Jun 2003 08:55:01 -0700
Since we're on the subject of the RSACryptoServiceProvider class, I thought
I would include here information that will be in the next release regarding
this class. Some folks stated they didn't know some of this information.
- default RSACryptoServiceProvider rsa = RSACryptoServiceProvider()
constructor
generates new RSA public/private transient key-pairs each time invoked.
- if rsa.PersistKeyInCsp = true is used, a random key container name,
prepended
with "CLR" is persisted
- overloaded RSACryptoServiceProvider rsa =
RSACryptoServiceProvider(CspParameters cp)
creates (or reuses an existing) a persistent key container with the name
specified
in cp.KeyContainerName
- for this overloaded constructor, if the only CspParameters field specified
is
KeyContainerName, the RSA key-pair generated (or re-used) is the key pair of
type AT_KEYEXCHANGE. CryptoAPI key containers using the MS CSPs can contain
two types of key-pairs (key spec): AT_KEYEXCHANGE and AT_SIGNATURE which the
WinCrypt.h header file defines as 1 and 2 respectively.
- although not clearly documented, it appears that the key type is specified
as
CspParameters.KeyNumber
with KeyNumber= 1 (AT_KEYEXCHANGE) and KeyNumber=2 (AT_SIGNATURE)
and with AT_EXCHANGE being the default.
- if a RSACryptoServiceProvider is instantiated twice, once with KeyNumber=1
and then
2, supplying the same cp.KeyContainerName, then the same CryptoAPI
keycontainer
will be populated with 2 sets of keys in the same named key container. (This
is
similar to the PSDK sample code for generating a key container with both
Signature
and Exchange key pairs).
-- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm "Pieter Philippaerts" <pieter@nospam.mentalis.org> wrote in message news:u5mzBDBMDHA.3144@tk2msftngp13.phx.gbl... > "Michel Gallant" <neutron@istar.ca> wrote in message > > Currently with 1.0/1.1 .NET Framework classes, RSACryptoServiceProvider > > constructors support initializing with existing RSA credentials using the > CspParameters > > argument. > > I think it would be very useful to have a constructor supporting an > > exported public-key file argument. This would be very handy, for example, > > in using signature verification where end-users currently need to populate > > CspParameters explicitly with modulus and exponent properties. > > While we're at the subject of RSACryptoServiceProvider improvements, why not > implement the EncryptValue and DecryptValue methods? I'm still wondering why > MS didn't implement those in the first place... > > Regards, > Pieter Philippaerts > >
- Next message: David Puplava: "Digest Authentication Help"
- Previous message: David: "Https postback"
- In reply to: Pieter Philippaerts: "Re: Suggested additional constructor for RSACryptoServiceProvider"
- Next in thread: Michel Gallant: "Re: Suggested additional constructor for RSACryptoServiceProvider"
- Reply: Michel Gallant: "Re: Suggested additional constructor for RSACryptoServiceProvider"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|