mirror of
https://github.com/voideditor/void
synced 2026-05-24 09:58:23 +00:00
14 lines
790 B
PowerShell
14 lines
790 B
PowerShell
param ($CertBase64)
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$CertBytes = [System.Convert]::FromBase64String($CertBase64)
|
|
$CertCollection = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2Collection
|
|
$CertCollection.Import($CertBytes, $null, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::Exportable -bxor [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::PersistKeySet)
|
|
|
|
$CertStore = New-Object System.Security.Cryptography.X509Certificates.X509Store("My","LocalMachine")
|
|
$CertStore.Open("ReadWrite")
|
|
$CertStore.AddRange($CertCollection)
|
|
$CertStore.Close()
|
|
|
|
$ESRPAuthCertificateSubjectName = $CertCollection[0].Subject
|
|
Write-Output ("##vso[task.setvariable variable=ESRPAuthCertificateSubjectName;]$ESRPAuthCertificateSubjectName")
|