Mono(sn)

πŸ“¦
version 6.14.1 Β· 2 versions
, in alpine 3.24, epel 10, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’– 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.

  • -c provider β€” 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/verificationSettings in machine.config.
  • -Vr assembly [userlist] β€” exempt the specified assembly from verification for the specified user list. Currently not supported by sn. You have to go edit machine.config manually if you need this. πŸ’€
  • -Vu assembly β€” remove the exemption entry for the specified assembly. Currently not supported by sn, you must edit machine.config manually if you require this.
  • -Vx β€” remove all exemptions entries. Currently not supported by sn, you must edit machine.config manually if you require this.

  • -d container β€” delete the keypair that's currently chilling in the specified key container.
  • -i keypair.snk container β€” import the specified strongname file into the specified container.
  • -pc container publickey β€” export the public key from the specified CSP container out to the specified file.

πŸ”„ CONVERSION OPTIONS πŸ”„

  • -e assembly output.pub β€” export the assembly public key to the specified output file.
  • -p keypair.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.
  • -o input output.txt β€” convert the input file to a CSV file (using decimal).
  • -oh input output.txt β€” convert the input file to a CSV file (using hexadecimal).

πŸ‘‘ STRONGNAME SIGNING OPTIONS πŸ‘‘

  • -D assembly1 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 is 1024 bits and MUST ALWAYS be used when signing 1.x assemblies. Any value from 384 to 16384 bits (in increments of 8 bits) is a valid key length for signing 2.x assemblies. For maximum compatibility you may want to keep using 1024 bit keys. Also, note that there's no good reason, even if it's possible, to use a length lesser than 1024 bits. Like, why would you. πŸ™ˆ
  • -R assembly 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 in machine.config).
  • -Rc assembly container β€” re-sign the specified assembly using the specified strongname container.
  • -t file β€” show the public key token from the specified file.
  • -tp file β€” show the public key and the public key token from the specified file. Two for one, slay ✨
  • -T assembly β€” show the public key token from the specified assembly.
  • -Tp assembly β€” show the public key and the public key token from the specified assembly.
  • -v assembly β€” verify the specified assembly signature.
  • -vf assembly β€” 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 (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 🫢

secutil(1)


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