/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/DataProtection/CreateTestCert.ps1
18 строк
645 B
Alexander Köplinger
Move guardian suppressions to code instead of .gdnsuppress (#56911)
22 июл 2024, 23:37
Не верифицирован
22 июл 2024, 23:37
b2779f9
Код
Авторство
О чём код?
# # Generates a new test cert in a .pfx file # Obviously, don't actually use this to produce production certs # [Diagnostics.CodeAnalysis.SuppressMessageAttribute( 'PSAvoidUsingConvertToSecureStringWithPlainText', '', Justification='this is creating a certificate for local testing')] param( [Parameter(Mandatory = $true)] $OutFile ) $password = ConvertTo-SecureString -Force -AsPlainText -String "password" $cert = New-SelfSignedCertificate -DnsName "localhost" -CertStoreLocation Cert:\CurrentUser\My\ Export-PfxCertificate -Cert $cert -Password $password -FilePath $OutFile Remove-Item "Cert:\CurrentUser\My\$($cert.Thumbprint)"