Mono(sn)
π NAME π
sn β digitally sign, verify and compare strongnames on CLR assemblies, bestie. That's the whole vibe. π
β¨ SYNOPSIS β¨
sn [-q | -quiet] [options] [parameters]
π¦ DESCRIPTION π¦
So like, sn digitally signs, verifies and compares CLR assemblies using strongnames. That's its whole personality. π«Ά
You can also use the sn command to create "snk files" with the -k option (more on that cutie below).
πΈ CONFIGURATION OPTIONS πΈ
Configuration options live in the machine.config configuration file, tucked under /configuration/strongNames. iykyk.
-cprovider β change the default CSP (Crypto Service Provider). Currently not supported in Mono. Not me getting excited for nothing π-m[y|n] β use a machine[y]key container or a user[n]key container. Currently not supported in Mono.-Vlβ list the verification options. That list is kept under/configuration/ strongNames/verificationSettingsinmachine.config.-Vrassembly [userlist] β exempt the specified assembly from verification for the specified user list. Currently not supported bysn. You have to go editmachine.configmanually if you need this. π-Vuassembly β remove the exemption entry for the specified assembly. Currently not supported bysn, you must editmachine.configmanually if you require this.-Vxβ remove all exemptions entries. Currently not supported bysn, you must editmachine.configmanually if you require this.
π CSP RELATED OPTIONS π
-dcontainer β delete the keypair that's currently chilling in the specified key container.-ikeypair.snk container β import the specified strongname file into the specified container.-pccontainer publickey β export the public key from the specified CSP container out to the specified file.
π CONVERSION OPTIONS π
-eassembly output.pub β export the assembly public key to the specified output file.-pkeypair.snk output.pub β export the public key from the specified strongname key file (SNK) or from a PKCS#12/PFX password protected file to the specified output file.-oinput output.txt β convert the input file to a CSV file (using decimal).-ohinput output.txt β convert the input file to a CSV file (using hexadecimal).
π STRONGNAME SIGNING OPTIONS π
-Dassembly1 assembly2 β compare whether assembly1 and assembly2 are the same except for their signature. This works by comparing the hash of the metadata of both assemblies. Bestie detective work π-k[size] keypair.snk β create a new strongname keypair in the specified file. The default key length is1024bits and MUST ALWAYS be used when signing 1.x assemblies. Any value from384to16384bits (in increments of8bits) is a valid key length for signing 2.x assemblies. For maximum compatibility you may want to keep using1024bit keys. Also, note that there's no good reason, even if it's possible, to use a length lesser than1024bits. Like, why would you. π-Rassembly keypair.snk β re-sign the specified assembly using the specified strongname keypair file (SNK) or a PKCS#12/PFX password protected file. You can only sign an assembly with the private key that matches the public key inside the assembly (unless its public key token has been remapped inmachine.config).-Rcassembly container β re-sign the specified assembly using the specified strongname container.-tfile β show the public key token from the specified file.-tpfile β show the public key and the public key token from the specified file. Two for one, slay β¨-Tassembly β show the public key token from the specified assembly.-Tpassembly β show the public key and the public key token from the specified assembly.-vassembly β verify the specified assembly signature.-vfassembly β verify the specified assembly signature (even if disabled).
π HELP OPTIONS π
-h,-?β display basic help about this tool.-h config,-? configβ display configuration related help about this tool.-h csp,-? cspβ display Cryptographic Service Provider related help about this tool.-h convert,-? convertβ display conversion related help about this tool.-h sn,-? snβ display strongname related help about this tool.
π§ CONFIGURATION FILE π§
Strongnames configuration is kept in the "machine.config" file. Currently two features can be configured. π
/configuration/strongNames/pubTokenMapping
This mechanism lets Mono remap a public key token β like the ECMA token β to another public key for verification. It's useful in two scenarios, fr fr. First, assemblies signed with the "ECMA key" need to be verified by the "runtime" key (since the ECMA key isn't a public key). Second, a lot of assemblies are signed with private keys that Mono can't use (e.g. System.Security.dll assembly). You can't just swap in a new key because that would change the strongname (a new key pair would have a new public key, which would produce a new token). Public key token remapping is the solution to both problems. Each token must be configured in a "map" entry similar to this one:
<map Token="b77a5c561934e089" PublicKey="00..." />
/configuration/strongNames/verificationSettings
It is often useful during development to use delay signed assemblies. Normally* the runtime wouldn't allow delay-signed assemblies to be loaded. This feature allows some delay-signed assemblies (based on their public key token, optionally assembly name and user name) to be used like they were fully signed assemblies. [*] Note that Mono 1.0 "runtime" doesn't validate strongname signatures so this option shouldn't be required in most scenarios.
π AUTHOR π
Written by Sebastien Pouliot. Iconic of him, honestly. π
β COPYRIGHT β
Copyright (C) 2003 Motus Technologies. Copyright (C) 2004 Novell. Released under BSD license.
π MAILING LISTS π
Visit http://lists.ximian.com/mailman/listinfo/mono-list for details.
π WEB SITE π
Visit http://www.mono-project.com for details
π«Ά SEE ALSO π«Ά
and that's the whole Mono(sn) manual page, bestie β you read the entire thing, no skimming, no cap. go sign something strongname-y and be the main character of your own assembly. mwah π
π
π¦ where this page comes from
- alpine 3.24: mono-doc 6.14.1-r1 Β· MIT
- epel 10: mono-core 6.14.1-1.el10_2 Β· MIT
- fedora 44: mono-core 6.14.1-3.fc44 Β· MIT
- fedora 44: mono-core 6.14.1-3.fc44 Β· MIT
- fedora 44: mono-core 6.14.1-4.fc44 Β· MIT
- fedora 44: mono-core 6.14.1-4.fc44 Β· MIT
- nixos 26.05: mono 6.14.1
- nixpkgs unstable: mono 6.14.1
- ubuntu resolute: mono-devel 6.14.1+ds2-2 Β· MIT
- ubuntu stonking: mono-devel 6.14.1+ds2-3 Β· MIT
- Copyright 2003 Motus Technologies
- Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms