X509 Certificates and Riijndael encryption
From: Mattia Saccotelli ("m.saccotelli)
Date: 11/23/04
- Next message: Wayne: "code standards / guide lines"
- Previous message: Jon Skeet [C# MVP]: "Re: How good an encryption algorithm is this?"
- Next in thread: Mattia Saccotelli: "Re: X509 Certificates and Riijndael encryption"
- Reply: Mattia Saccotelli: "Re: X509 Certificates and Riijndael encryption"
- Reply: Mattia Saccotelli: "Re: X509 Certificates and Riijndael encryption"
- Reply: Nicholas Paldino [.NET/C# MVP]: "Re: X509 Certificates and Riijndael encryption"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 23 Nov 2004 14:49:29 +0100
Hi
I would like to encrypt data using AES (Rijndael) algorithm, providing
as the key the key from a given certificate. Just for testing I'm using
the public key..
Shouldn't I use the private key instead of the public one?
Is there a way to get it or to use such algorithm with a specified
private key from a certificate (which may eventually be on a regular file)?
--
About the public key I did the following to get an appropriate key length:
private byte[] getKey() {
X509Certificate cer =
X509Certificate.CreateFromCertFile(@"c:\tmp\certificates\mattia.cer");
byte[] certKey = cer.GetPublicKey();
byte[] theKey = new byte[keySize / 8];
for (int i = 0; i < (keySize / 8) && i < certKey.Length; i++) {
theKey[i] = certKey[i];
}
return theKey;
}
BTW I think it's not the right way to solve the problem, I can't simply
truncate the key to the needed length.
- Next message: Wayne: "code standards / guide lines"
- Previous message: Jon Skeet [C# MVP]: "Re: How good an encryption algorithm is this?"
- Next in thread: Mattia Saccotelli: "Re: X509 Certificates and Riijndael encryption"
- Reply: Mattia Saccotelli: "Re: X509 Certificates and Riijndael encryption"
- Reply: Mattia Saccotelli: "Re: X509 Certificates and Riijndael encryption"
- Reply: Nicholas Paldino [.NET/C# MVP]: "Re: X509 Certificates and Riijndael encryption"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|