473,386 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Question about signing XML and RSA

Hello.

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? On my machine (which is pretty fast) it
takes seconds to call RSA.Create() 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.

Thank you.

/David.
Nov 12 '05 #1
2 1591
"David Lindgren" <da************@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
Nov 12 '05 #2
Here is a handy .NET tool, which helps you find your CspParameters
credentials for any existing RSA keys populating your Current User
MY keystore:
http://www.jensign.com/JavaScience/dotnet/keypal

- Michel Gallant
MVP Security

"Pieter Philippaerts" <Pi****@nospam.mentalis.org> wrote in message
news:eO****************@TK2MSFTNGP11.phx.gbl...
"David Lindgren" <da************@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

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Tim Mulholland | last post by:
Hello all, Our company is trying to write some code in C#/.NET that we don't want an end user to be able to see. The algorithms are not that complex, but are sensitive such that if a user could...
1
by: Martin | last post by:
I have a couple of questions around code signing with MS technology: 1. Is there a way to transfer the generated strong name signing private key directly to a smartcard (or generate it on the...
10
by: DBC User | last post by:
Hi All, Someone shed some light in to this strong name signing issue I have. My assembly uses a 3rd party controls so I end up distributing their dlls along with my assembly. I put this app in...
6
by: raylopez99 | last post by:
Anybody use Strong Name Signing? I think this is used by default for Resource files, which is one reason perhaps I can't get my resource files to work (somehow the public key is messed up, perhaps...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.