Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MauRiEEZZZ/ceb6f96c946707925072e2b02e78fd38 to your computer and use it in GitHub Desktop.
Save MauRiEEZZZ/ceb6f96c946707925072e2b02e78fd38 to your computer and use it in GitHub Desktop.
This little script will create a certificate that can be used for the Master Collumn Encryption Key, location and private key permissions will need to be altered
$storeLocation = "CurrentUser"
$certPath = "Cert:" + $storeLocation + "\My"
$cert = New-SelfSignedCertificate -Subject "cert1" -CertStoreLocation $certPath -KeyExportPolicy Exportable -Type CodeSigningCert -KeySpec None -KeyUsage KeyEncipherment -HashAlgorithm sha256 -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.8.2.2,1.3.6.1.4.1.311.10.3.11")
# keep in mind the Serviceaccount needs access to the private key, permissions need to be set and also the location would need to be altered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment