How to get the public key

J

Joe Abou Jaoude

Hi,
I am using StrongNameIdentityPermission to restrict users to access our
dll components.
we use a file key.snk to sign our assemblies with a strong name.
Now I want to retrieve the public key from key.snk to give the
StrongNameIdentityPermission attribute the proper publickey value.
<StrongNameIdentityPermission( SecurityAction.LinkDemand, _
PublicKey:="..." >

I tried to accomplish that using the sn utility, without any success.
sn -p gives me the public key encrypted
sn -t gives me the public key token wich apparently is something
different from the public key.

So obviously I am doing something wrong, and i was thinking that maybe
we can't extract the public key this way for security reasons. so how
can I get it ?

thanks
 
G

Guest

I tried to accomplish that using the sn utility, without any success.
sn -p gives me the public key encrypted

No the output isn't encrypted. If you run sn -tp on the public key file
generated by sn -p it should give you the expected result. Or just run sn -Tp
on an assembly signed with the key file.


Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top