473,382 Members | 1,658 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,382 software developers and data experts.

read asymmetric keys from C#

Hi, i'm trying to use the .NET cryptography API to encrypt XML data
and move XML files between computers.
i'm using asymmetric keys to encrypt the xml tag data with the
receiver's public key, then compute a hash for the whole file and sign
it with my private key.
My problem now lies in finding and reading the keys to make them
available to my program.
i tried creating a certificate with a tool called makecert that comes
with windows 2003 server sdk.
the tool created a certificate file and a private key file but no
public key file, i think i can still copy the public key from the
certificate and save it to a file.

makecert.exe -pe -sv "%HOME%\My Documents\keys\key.pvk" -ss
DataCert.ks -a sha1 -sky exchange -b 01/01/2000 -e 12/31/2040
DataCert.cer

but how do i read the keys from the files into my C# program?

C# seems to provide a way to read a key from an XML string not from a
normal string or a file !
so this won't work
RSACryptoServiceProvider rsaPrivate = new RSACryptoServiceProvider();
rsaPrivate.FromXmlString(rsaPrivKey); // reads keys only from an XML
like syntax

i can though load the file, read the contents into a string and pass
it on to "FromXmlString" but i don't know the required xml syntax.

how would i go on this one?
Jun 27 '08 #1
0 1201

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

Similar topics

6
by: Tex John | last post by:
Is there a way to do asymmetric encryption purely in PHP? Not for e-mail...could care less. But for credit card number processing, if the bookkeeper could have a password she typed in every time...
0
by: Arpan | last post by:
How to decrypt a message using Asymmetric Algorithm (RSA Crypto Service provider) using .Net. I have successfully sent an encrypted message using recepient's public key but dont know how to...
8
by: Pham Nguyen | last post by:
I haven't used the READ UNCOMMITTED transaction isolation level before, and I was wondering if this would be an appropriate use: I have an ID table containing ID numbers that are randomly...
13
by: Andy Chau | last post by:
I try to use RSA to implement the following scheme but wasn't sucessful. Sever encrypt a message using a public key, the client decrpyt the message using a private key. I don't want the client...
2
by: Paul Fi | last post by:
I have this encryption scheme that I want to implement: I have an authentication server, which takes clients' credentials to complete authentication but first I have to encrypt the credentials, I...
0
by: ddnash | last post by:
We are installing an application that requires access to the ms-sql-m protocol (UDP/1434) as well as the data port (TCP/1433). The SQL Server we are using is part of an N+1 cluster. The issue is...
4
by: pintu | last post by:
Hello everybody.. I hav some confusion regarding asymmetric encryption.As asymmetric encryption it there is one private key and one public key.So any data is encrypted using private key and the...
3
by: dfa_geko | last post by:
Hi All, I had a question about encrypting and decrypting XML files using asymmetric keys. I copied some sample code from MSDN, here are the samples: ...
3
by: Bruce | last post by:
How can I encrypt strings using an asymmetric key? I want to encrypt short strings (credit card numbers, etc.) and save the encrypted strings into a database. When accessing the data (i.e. the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.