winpr-makecert(1)

✨ NAME ✨

winpr-makecert β€” a whole tool for making X.509 certificates, no big deal πŸ’–

πŸ¦‹ SYNOPSIS πŸ¦‹

winpr-makecert [-rdp] [-silent] [-live] [-format { crt | pem | pfx }]
[-p password] [-n common_name] [-y years] [-m months] [-len length] [-#
serial] [-a { md5 | sha1 | sha256 | s384 | sha512 }] [-path outputpath]
[outputname]

πŸ’… DESCRIPTION πŸ’…

Okay so bestie, winpr-makecert is the tool you reach for when you need to generate X.509 certificates. It's modeled after the Windows command MakeCert, and the whole vibe is that it wants to be command line compatible with MakeCert. But β€” and this is important β€” not all the options are supported or implemented yet, okay? It's giving "we're getting there" energy. 🌱

Anything that isn't implemented yet? It's not written up in here at all. Those bits get marked as "Unsupported" in winpr-makecert's help, so if you're looking for them, that's where they live. πŸ‘€

Now here's where it diverges from its Windows counterpart: unless you pass the -live option, winpr-makecert always creates and saves a certificate. Always. Every single time. If you don't set outputname, it'll try to figure out the host name of the computer you're running the command on and use that instead. πŸ–₯️

⚠️ WARNING, FR FR: if the file already exists, it gets overwritten without asking. No prompt, no "are you sure", no nothing. It just goes. So like… check yourself before you wreck yourself. πŸ’€

And if you run it with no further options at all, the certificate you get has these properties, periodt:

  • 2048 bit long
  • sha256 as hash algorithm
  • the detected host name is used as common name
  • a time stamp is used as serial number
  • validity period of one year
  • saved in the current working directory in crt format

🌸 OPTIONS 🌸

  • -rdp β€” a dummy parameter, lowkey. Its whole purpose in life is letting you quickly generate a certificate with all the default properties without specifying any further parameters. Iconic shortcut behavior. πŸŽ€
  • -silent β€” don't print the generated certificate to stdout. Shy mode. πŸ™ˆ
  • -f format β€” three formats are supported: crt, pem and pfx. Let's break it down:
    • crt outputs the key and the certificate in a separate file each, with the file endings .key and .crt.
    • pem outputs the key and certificate into a single file with the file ending pem.
    • And pfx outputs key and certificate into a pkcs12 file with the ending .pfx.
  • -p password β€” the password to use if pfx is the format you picked. 🀫
  • -live β€” don't write the key/certificate to disk. When you use this from the command line, think of it as "dummy" mode.
  • -n common_name β€” the common name to use in the certificate.
  • -m months β€” validity period in months (a multiple of 31 days, not calendar months). Yeah, it's doing its own math. ✨
  • -y years β€” validity period in years (365 days, leap years not accounted for). And if you specify both months and years, the values are accumulated. Stack 'em up. 🧚
  • -len length β€” key length in bits to use.
  • -a { md5 | sha1 | sha256 | s384 | sha512 } β€” the hashing algorithm to use.
  • -# serial β€” the serial number to use for the certificate.
  • -path β€” a directory where the certificate should be created in.
  • outputname β€” the base name of the created file(s). A suffix gets appended to this name β€” specifically the format specific suffix. πŸ’«

πŸ”₯ EXAMPLES πŸ”₯

winpr-makecert -rdp

Creates a certificate with the default properties, saved to a file in the current working directory in crt format, named like the host. So if the host is named freerdp, the created files are called freerdp.key and freerdp.crt. Chef's kiss. πŸ‘‘

winpr-makecert -len 4096 -a sha384 -path /tmp -# 22 -m 144 -y 1 -format
crt mycert

The command above creates the file /tmp/mycert.pem containing a key and a certificate with a length of 4096. It will use sha384 as hash algorithm. The certificate has the serial number 22 and is valid for 12 years (144 months). Look at her go. 🌈


🫢 EXIT STATUS 🫢

  • 0 β€” Successful program execution. Slay. βœ…
  • 1 β€” Otherwise. 😭

πŸ‘‘ SEE ALSO πŸ‘‘

MakeCert help page ⟨https://msdn.microsoft.com/library/windows/desktop/aa386968.aspx⟩

πŸ’œ AUTHOR πŸ’œ

FreeRDP <team@freerdp.com>


And that's the whole page, bestie β€” brought to you by FreeRDP version 3.32.2, dated 2017-01-11, filed under winpr-makecert(1). Go make some certificates, you got this. πŸ’–βœ¨

πŸ“¦ where this page comes from