|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Generate key file in codeHi,
Instead of running "sn-k" to generate a key pair, I need to generate the key file in code, is there anyone know how to generate key files in .NET code? Any help is appreciated. Gnic Hello Gnic,
sn.exe even is not .net app. Seems that you can't get key programmatically. G> Instead of running "sn-k" to generate a key pair, I need to generate G> the key file in code, is there anyone know how to generate key files G> in .NET code? --- WBR, Michael Nemtsev :: blog: http://spaces.msn.com/members/laflour "At times one remains faithful to a cause only because its opponents do not cease to be insipid." (c) Friedrich Nietzsche Gnic,
Michael pointed out that sn.exe is not a managed application, so we can't reflect it to determine what the code is that it is using. What you could do is use an instance of the Process class to run the utility, and then open the file and read the contents. Hope this helps. -- Show quote- Nicholas Paldino [.NET/C# MVP] - mvp@spam.guard.caspershouse.com "Gnic" <gas***@hotmail.com> wrote in message news:udtTKL0JGHA.1676@TK2MSFTNGP09.phx.gbl... > Hi, > > Instead of running "sn-k" to generate a key pair, I need to generate the > key file in code, is there anyone know how to generate key files in .NET > code? > > Any help is appreciated. > > Gnic > Nicholas Paldino [.NET/C# MVP] wrote:
> Gnic, SSCLI shows that it uses the methods exported from mscoree.dll. Of > > Michael pointed out that sn.exe is not a managed application, so we > can't reflect it to determine what the code is that it is using. > > What you could do is use an instance of the Process class to run > the utility, and then open the file and read the contents. course, you'll have to call these though platform invoke. Thy are documented either in MSDN or in the strong name header file in the tools developers guide. StrongNameKeyGen looks like a good one to try :-) Richard -- Fusion Tutorial: http://www.grimes.demon.co.uk/workshops/fusionWS.htm Security Tutorial: http://www.grimes.demon.co.uk/workshops/securityWS.htm I made a getkey util on Channel9 sandbox that may help you.
http://channel9.msdn.com/ShowPost.aspx?PostID=80076#80076 -- Show quoteWilliam Stacey [MVP] "Gnic" <gas***@hotmail.com> wrote in message news:udtTKL0JGHA.1676@TK2MSFTNGP09.phx.gbl... | Hi, | | Instead of running "sn-k" to generate a key pair, I need to generate the key | file in code, is there anyone know how to generate key files in .NET code? | | Any help is appreciated. | | Gnic | | I'm sure William is a very decent chap however you should be aware that you
should never use crypto key generators from someone you do not trust totally to be both accurate and honest as it may not be secure. Also I'm curious to know why you would want a lot of RSA key pairs. private key crypto fine but public key crypto? Show quote "William Stacey [MVP]" <william.sta***@gmail.com> wrote in message news:OMeVwN6JGHA.3960@TK2MSFTNGP09.phx.gbl... >I made a getkey util on Channel9 sandbox that may help you. > http://channel9.msdn.com/ShowPost.aspx?PostID=80076#80076 > > -- > William Stacey [MVP] > > "Gnic" <gas***@hotmail.com> wrote in message > news:udtTKL0JGHA.1676@TK2MSFTNGP09.phx.gbl... > | Hi, > | > | Instead of running "sn-k" to generate a key pair, I need to generate the > key > | file in code, is there anyone know how to generate key files in .NET > code? > | > | Any help is appreciated. > | > | Gnic > | > | > > I would not either. But the source is there, and it just calls MS libs, so
I guess the user can decide. Cheers. -- Show quoteWilliam Stacey [MVP] "Nick Hounsome" <nh***@nickhounsome.me.uk> wrote in message news:iojEf.236173$vl2.108544@fe2.news.blueyonder.co.uk... | I'm sure William is a very decent chap however you should be aware that you | should never use crypto key generators from someone you do not trust totally | to be both accurate and honest as it may not be secure. | | Also I'm curious to know why you would want a lot of RSA key pairs. private | key crypto fine but public key crypto? | | "William Stacey [MVP]" <william.sta***@gmail.com> wrote in message | news:OMeVwN6JGHA.3960@TK2MSFTNGP09.phx.gbl... | >I made a getkey util on Channel9 sandbox that may help you. | > http://channel9.msdn.com/ShowPost.aspx?PostID=80076#80076 | > | > -- | > William Stacey [MVP] | > | > "Gnic" <gas***@hotmail.com> wrote in message | > news:udtTKL0JGHA.1676@TK2MSFTNGP09.phx.gbl... | > | Hi, | > | | > | Instead of running "sn-k" to generate a key pair, I need to generate the | > key | > | file in code, is there anyone know how to generate key files in .NET | > code? | > | | > | Any help is appreciated. | > | | > | Gnic | > | | > | | > | > | | |
|||||||||||||||||||||||