Skip to content

Instantly share code, notes, and snippets.

@derektamsen
Last active May 15, 2025 19:03
Show Gist options
  • Save derektamsen/d8cc127927f7a21765dc68418a3e8b47 to your computer and use it in GitHub Desktop.
Save derektamsen/d8cc127927f7a21765dc68418a3e8b47 to your computer and use it in GitHub Desktop.
Create a self-signed certificate on windows and add it to the local machine certificate store. The generated certificate can only be used for webservers and does not include extensions for client usage.
@Params = @{
KeyAlgorithm = 'ECDSA_nistP256'
KeyUsage = 'DigitalSignature'
DnsName = $(hostname)
CertStoreLocation = 'cert:\LocalMachine\My'
TextExtension = @('2.5.29.37={text}1.3.6.1.5.5.7.3.1')
}
New-SelfSignedCertificate @Params -confirm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment