Created
October 24, 2017 19:17
-
-
Save nordineb/81ac24e73be39e0efe315228799558ba to your computer and use it in GitHub Desktop.
Create p2S certificates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if you already have a root certificate | |
$cert= Get-ChildItem -Path “Cert:\CurrentUser\My” | where { $_.subject -eq "CN=NordineRootCertForP2SVPN" } | |
# otherwise create a self-signed root certificate | |
$cert = New-SelfSignedCertificate -Type Custom -KeySpec Signature ` | |
-Subject "CN=RootCertForP2SVPN" -KeyExportPolicy Exportable ` | |
-HashAlgorithm sha256 -KeyLength 2048 ` | |
-CertStoreLocation "Cert:\CurrentUser\My" -KeyUsageProperty Sign -KeyUsage CertSign | |
#Create a certificate | |
New-SelfSignedCertificate -Type Custom -KeySpec Signature ` | |
-Subject "CN=RootCertForP2SVPN_2" -KeyExportPolicy Exportable ` | |
-HashAlgorithm sha256 -KeyLength 2048 ` | |
-CertStoreLocation "Cert:\CurrentUser\My" ` | |
-Signer $cert -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.2") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment