|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
RsaCryptoServiceProvider doubtHi,
I have a certificate and it's private key. I'm accessing my certificate and my private key using the X509Certificate2. My problem is: I can't pass to the RsaCryptoServiceProvider class my Private and Public key. How can i do it ? Thanks in advance, Victor The X509Certificate2.PublicKey.Key property will give you an
RSACryptoServiceProvider for that certificate and the X509Certificate.PrivateKey property will give you an AsymmetricAlgorithm class you can use. Joe K. -- Show quoteHide quoteJoe Kaplan-MS MVP Directory Services Programming Co-author of "The .NET Developer's Guide to Directory Services Programming" http://www.directoryprogramming.net -- "Victor Pereira" <pelas***@gmail.com> wrote in message news:%23gDM4iGUHHA.1208@TK2MSFTNGP03.phx.gbl... > Hi, > > I have a certificate and it's private key. > > I'm accessing my certificate and my private key using the > X509Certificate2. > > My problem is: I can't pass to the RsaCryptoServiceProvider class my > Private and Public key. How can i do it ? > > Thanks in advance, > > Victor > Hi Joe,
Ok thanks for your reply. I think that i didn't explained very clearly my problem. I don't know how can i get these properties and populate the RsaCryptoServiceProvider structure to call the method Encrypt with my private key. Understood ? Thanks again, Victor Show quoteHide quote "Joe Kaplan" <joseph.e.kap***@removethis.accenture.com> escreveu na mensagem news:emermwKUHHA.528@TK2MSFTNGP03.phx.gbl... > The X509Certificate2.PublicKey.Key property will give you an > RSACryptoServiceProvider for that certificate and the > X509Certificate.PrivateKey property will give you an AsymmetricAlgorithm > class you can use. > > Joe K. > > -- > Joe Kaplan-MS MVP Directory Services Programming > Co-author of "The .NET Developer's Guide to Directory Services > Programming" > http://www.directoryprogramming.net > -- > "Victor Pereira" <pelas***@gmail.com> wrote in message > news:%23gDM4iGUHHA.1208@TK2MSFTNGP03.phx.gbl... >> Hi, >> >> I have a certificate and it's private key. >> >> I'm accessing my certificate and my private key using the >> X509Certificate2. >> >> My problem is: I can't pass to the RsaCryptoServiceProvider class my >> Private and Public key. How can i do it ? >> >> Thanks in advance, >> >> Victor >> > > are you sure you really wanna use the raw RSA key - or rather use the higher
level PKCS classes to encrypt the data? Have a look at this article: http://msdn.microsoft.com/msdnmag/issues/07/03/NETSecurity/default.aspx ----- Dominick Baier (http://www.leastprivilege.com) Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp) Show quoteHide quote > Hi Joe, > > Ok thanks for your reply. > > I think that i didn't explained very clearly my problem. > > I don't know how can i get these properties and populate the > RsaCryptoServiceProvider structure to call the method Encrypt with my > private key. Understood ? > > Thanks again, > > Victor > "Joe Kaplan" <joseph.e.kap***@removethis.accenture.com> escreveu na > mensagem > news:emermwKUHHA.528@TK2MSFTNGP03.phx.gbl... >> The X509Certificate2.PublicKey.Key property will give you an >> RSACryptoServiceProvider for that certificate and the >> X509Certificate.PrivateKey property will give you an >> AsymmetricAlgorithm class you can use. >> >> Joe K. >> >> -- >> Joe Kaplan-MS MVP Directory Services Programming >> Co-author of "The .NET Developer's Guide to Directory Services >> Programming" >> http://www.directoryprogramming.net >> -- >> "Victor Pereira" <pelas***@gmail.com> wrote in message >> news:%23gDM4iGUHHA.1208@TK2MSFTNGP03.phx.gbl... >>> Hi, >>> >>> I have a certificate and it's private key. >>> >>> I'm accessing my certificate and my private key using the >>> X509Certificate2. >>> >>> My problem is: I can't pass to the RsaCryptoServiceProvider class my >>> Private and Public key. How can i do it ? >>> >>> Thanks in advance, >>> >>> Victor >>> Guys,
How about this approach("cert" is X509Certificate2)? RSACryptoServiceProvider rsa_pub = (RSACryptoServiceProvider)cert.PublicKey.Key; or RSACryptoServiceProvider rsa_prv = (RSACryptoServiceProvider)cert.PrivateKey; Smorn Show quoteHide quote "Victor Pereira" wrote: > Hi Joe, > > Ok thanks for your reply. > > I think that i didn't explained very clearly my problem. > > I don't know how can i get these properties and populate the > RsaCryptoServiceProvider structure to call the method Encrypt with my > private key. Understood ? > > Thanks again, > > Victor > "Joe Kaplan" <joseph.e.kap***@removethis.accenture.com> escreveu na mensagem > news:emermwKUHHA.528@TK2MSFTNGP03.phx.gbl... > > The X509Certificate2.PublicKey.Key property will give you an > > RSACryptoServiceProvider for that certificate and the > > X509Certificate.PrivateKey property will give you an AsymmetricAlgorithm > > class you can use. > > > > Joe K. > > > > -- > > Joe Kaplan-MS MVP Directory Services Programming > > Co-author of "The .NET Developer's Guide to Directory Services > > Programming" > > http://www.directoryprogramming.net > > -- > > "Victor Pereira" <pelas***@gmail.com> wrote in message > > news:%23gDM4iGUHHA.1208@TK2MSFTNGP03.phx.gbl... > >> Hi, > >> > >> I have a certificate and it's private key. > >> > >> I'm accessing my certificate and my private key using the > >> X509Certificate2. > >> > >> My problem is: I can't pass to the RsaCryptoServiceProvider class my > >> Private and Public key. How can i do it ? > >> > >> Thanks in advance, > >> > >> Victor > >> > > > > > > >
How to bypass Forms Authentication on selected pages programmatica
Books on .net security Client certificates do not show up installing the last Root Update Client Certificate Selection Could not establish secure channel for SSL/TLS. Retrieving the private key associated with a certificate Impersonation in .NET 2.0 Do any microsoft buildtime dependancies C#/C/c++/VB/etc. need to be updated for the 2007 policy on d Display of encrypted data Manifest Files |
|||||||||||||||||||||||