RE: SN.EXE and Exported Public Keys
From: Brian R. (8B2H4R_N9G5M3S7_at_noemail.nospam)
Date: 10/28/04
- Next message: Steven Cheng[MSFT]: "RE: SN.EXE and Exported Public Keys"
- Previous message: Steven Cheng[MSFT]: "RE: SN.EXE and Exported Public Keys"
- In reply to: Steven Cheng[MSFT]: "RE: SN.EXE and Exported Public Keys"
- Next in thread: Steven Cheng[MSFT]: "RE: SN.EXE and Exported Public Keys"
- Reply: Steven Cheng[MSFT]: "RE: SN.EXE and Exported Public Keys"
- Reply: Richard Blewett [DevelopMentor]: "RE: SN.EXE and Exported Public Keys"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 27 Oct 2004 22:43:03 -0700
I thank you for your response, but it did not even address my original
question. My question was not what the SN.exe options were. My question is
why I get different output when I try to examine the public key from a
public/private key pair against the public key that was extracted from the
public key pair. SN.EXE shows me that they are different, but they should
not be.
Try the steps I mentioned in my original post. You will see that the public
key extracted differs from the original public key.
Try this:
sn -k privatepair.snk - Generate a public/private key pair
sn -p privatepair.snk publickey.snk - Extract only the public portion of the
key to file
sn -tp privatepair.snk - use SN.exe to display public key and public key
token
sn -tp publickey.snk - use SN.exe to display public key and public key token
Note that the results of the last two lines are distinctly different.
Shouldn't the extracted public key match the public key from the key pair?
Maybe this is confusing, but shouldn't the public keys match? Because they
don't.
"Steven Cheng[MSFT]" wrote:
> Hi Brian,
>
> Thanks for your posting, regarding on the question you mentioned, here're
> my understandings:
>
> the SN.exe tool can help generate public/private key pairs or display
> publickey/public key TOKEN from a key file or an assembly which is
> strong-named. Here is the functions of the sn.exe commands you mentioned:
>
> sn -k keyfile ------will write BOTH public and private key into the keyfile
> sn -p infile outfile ---------will write the public key only (in the infile
> ) into the outfile
> sn -tp infile will display the public key TOKEN and public key from the
> infile (which need to be generated
> by sn -p ).
>
> sn -t will only display the public key TOKEN(rather than public key)
>
> So you can use "sn -k" to genertae the key pair(both public and private)
> into a file. And then, we can use
> "sn -p" to write the public key from the key pair file into another
> separate file. For detailed reference, you can have a look at the following
> msdn document:
>
> #Strong Name Tool (Sn.exe)
> http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfstrongnameutilitys
> nexe.asp?frame=true
>
> Also, if we want to delaysign an assmbly, we can use the following
> attribute in AssemblyInfo.cs file generated by
> VS.NET if he is using the IDE
>
> [assembly: AssemblyDelaySign(true)]
> [assembly: AssemblyKeyFile("key file path")]
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
>
- Next message: Steven Cheng[MSFT]: "RE: SN.EXE and Exported Public Keys"
- Previous message: Steven Cheng[MSFT]: "RE: SN.EXE and Exported Public Keys"
- In reply to: Steven Cheng[MSFT]: "RE: SN.EXE and Exported Public Keys"
- Next in thread: Steven Cheng[MSFT]: "RE: SN.EXE and Exported Public Keys"
- Reply: Steven Cheng[MSFT]: "RE: SN.EXE and Exported Public Keys"
- Reply: Richard Blewett [DevelopMentor]: "RE: SN.EXE and Exported Public Keys"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|