Re: Question about signing XML and RSA
From: Pieter Philippaerts (Pieter_at_nospam.mentalis.org)
Date: 02/24/04
- Next message: David Lindgren: "How to protect your dll's best?"
- Previous message: James: "RE: SqlClientPermissions exception"
- In reply to: David Lindgren: "Question about signing XML and RSA"
- Next in thread: Michel Gallant: "Re: Question about signing XML and RSA"
- Reply: Michel Gallant: "Re: Question about signing XML and RSA"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 24 Feb 2004 09:31:36 +0100
"David Lindgren" <david.lindgren@hogia.se.REMOVE!> wrote
> I am trying to sign my XML files with private/public keys but I have
noticed
> that initiating the RSA key with either RSA.Create() or FromXMLString()
> takes a lot of time. I wonder why?
That's because the default constructor of the RSACryptoServiceProvider
creates a new public/private key pair whenever it's called.
> Is it possible to skip this part and read
> in the keys directly? What is the fastest way to get a RSA key to pass
> SignedXML.SigningKey ? I have generated keys already.
If you store your keys in a CryptoAPI key store, you can use the
RSACryptoServiceProvider(CspParameters) constructor to initialize an
RSACryptoServiceProvider instance. This is the fastest option because all it
has to do is associate the instance with the stored key.
If you don't want to put your key in a crypto store, you can use the
RSACryptoServiceProvider(int) constructor and pass it '512' to let it
generate a 512-bit key pair [this should be pretty fast] and then import
your key using the FromXMLString() method.
Regards,
Pieter Philippaerts
Managed SSL/TLS: http://mentalis.org/go.php?sl
- Next message: David Lindgren: "How to protect your dll's best?"
- Previous message: James: "RE: SqlClientPermissions exception"
- In reply to: David Lindgren: "Question about signing XML and RSA"
- Next in thread: Michel Gallant: "Re: Question about signing XML and RSA"
- Reply: Michel Gallant: "Re: Question about signing XML and RSA"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|