diff --git a/Exprelsior.sln b/Exprelsior.sln index c9d7b58..91a623e 100644 --- a/Exprelsior.sln +++ b/Exprelsior.sln @@ -15,7 +15,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Directory.Build.props = Directory.Build.props ExprelsiorKey.pfx = ExprelsiorKey.pfx icon.png = icon.png - Import-PfxCertificate.psm1 = Import-PfxCertificate.psm1 README.md = README.md EndProjectSection EndProject diff --git a/Import-PfxCertificate.psm1 b/Import-PfxCertificate.psm1 deleted file mode 100644 index 0ce403b..0000000 --- a/Import-PfxCertificate.psm1 +++ /dev/null @@ -1,31 +0,0 @@ -function Import-PfxCertificate { - Param ( - [string] $pfx, - [string] $password, - [string] $containerName - ); - process { - if(!(Test-Path -Path $pfx)) { - Write-Warning "Unable to locate PFX file: $pfx"; - return; - } - - $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2; - $cert.Import($pfx, $password, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::Exportable); - $exportPrivateKeyInformation = $true; - $certXml = $cert.PrivateKey.ToXmlString($exportPrivateKeyInformation); - - $csp = New-Object System.Security.Cryptography.CspParameters; - $csp.KeyContainerName = $containerName; - $csp.Flags = [System.Security.Cryptography.CspProviderFlags]::UseMachineKeyStore -bor [System.Security.Cryptography.CspProviderFlags]::NoPrompt; # -bor is bitwise or - $csp.KeyNumber = [System.Security.Cryptography.KeyNumber]::Signature; - - $rsa = New-Object System.Security.Cryptography.RSACryptoServiceProvider $csp; - $rsa.FromXmlString($certXml); - $rsa.Clear(); - - "Sucesfully imported $pfx into StrongName CSP store"; - } -} - -Export-ModuleMember -Function Import-PfxCertificate; \ No newline at end of file