July 2017
Beginner
222 pages
5h 2m
English
The New-SelfSignedCertificate command packages a lot of functionality. In the following sample, we are creating a self-signed certificate authority certificate:
$enforceLevels = $true$levelOfSubCertsAllowed = 0;$isCa = $true;$isCritical = $true;$caConstraint = New-Object System.Security.Cryptography.X509Certificates.X509BasicConstraintsExtension ` -ArgumentList @($isCa, $enforceLevels, $levelOfSubCertsAllowed, $isCritical)$caCert = New-SelfSignedCertificate -CertStoreLocation 'Cert:\CurrentUser\MY' -Subject "My Certificate Authority" -Extension @($caConstraint) -NotAfter (Get-Date).AddYears(20) -KeyLength 4096 -KeyAlgorithm RSA -FriendlyName 'MyCA' -Type Custom -KeyUsage DigitalSignature, CRLSign, CertSign
Let's ...
Read now
Unlock full access