8000 Add Password parameter to Get-PfxCertificate cmdlet by maybe-hello-world · Pull Request #6113 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Add Password parameter to Get-PfxCertificate cmdlet #6113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 23, 2018
Prev Previous commit
Next Next commit
Small comments changes
  • Loading branch information
maybe-hello-world committed Feb 7, 2018
commit b3955f5fc4a4074fc5f158b46ce919f6cc96756b
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public string[] LiteralPath
private bool _isLiteralPath = false;

/// <summary>
/// Gets or sets the password for unlocking the certificate
/// Gets or sets the password for unlocking the certificate.
/// </summary>
[Parameter(Mandatory = false)]
public SecureString Password { get; set; }
Expand Down Expand Up @@ -190,7 +190,6 @@ protected override void ProcessRecord()

private static X509Certificate2 GetCertFromPfxFile(string path, SecureString password)
{
// Passing null password and DefaultKeySet here is equivalent to calling "new X509Certificate2(path)"
var cert = new X509Certificate2(path, password, X509KeyStorageFlags.DefaultKeySet);
return cert;
}
Expand Down
0