all scripts
This commit is contained in:
17
import_export_starew.ps1
Normal file
17
import_export_starew.ps1
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
#not Tested
|
||||
|
||||
$certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\Users\a.warme\Downloads\star.east-west.dk-2024-02-05\star.east-west.dk-2024-02-05.pfx","thales")
|
||||
$store = New-Object System.Security.Cryptography.X509Certificates.X509Store("My", "LocalMachine")
|
||||
$store.Open("ReadWrite")
|
||||
$store.Add($certificate)
|
||||
$store.Close()
|
||||
|
||||
|
||||
$CertStore = New-Object System.Security.Cryptography.X509Certificates.X509Store("My", "LocalMachine")
|
||||
$CertStore.Open("ReadOnly")
|
||||
|
||||
$Certificate = $CertStore.Certificates | Where-Object {$_.Subject -eq "CN=star.east-west.dk"}
|
||||
$Base64 = [System.Convert]::ToBase64String($Certificate.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert))
|
||||
|
||||
Write-Output $Base64
|
||||
Reference in New Issue
Block a user