Created
September 10, 2016 11:36
-
-
Save PlagueHO/40c20a6cc143d3856c9c23da88843642 to your computer and use it in GitHub Desktop.
Export a Base-64 x.509 certificate on Windows 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$certificate = Get-ChildItem -Path Get-ChildItem -path Cert:\CurrentUser\My\D675AE3AE9F7B56348C17EE527F261CFCEA0FD13 | |
$base64certificate = @" | |
-----BEGIN CERTIFICATE----- | |
$([Convert]::ToBase64String($certificate.Export('Cert'), [System.Base64FormattingOptions]::InsertLineBreaks))) | |
-----END CERTIFICATE----- | |
"@ | |
Set-Content -Path "$ENV:USERPROFILE\Documents\MyCert.cer" -Value $base64certificate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment