Skip to content
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

Add ACL support for Certificates #21353

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -186,4 +186,25 @@
<data name="RemoteErrorMessage" xml:space="preserve">
<value>. The following error may be a result of user credentials required on the remote machine. See Enable-WSManCredSSP Cmdlet help on how to enable and use CredSSP for delegation with PowerShell remoting. </value>
</data>
<data name="CannotGetAclWrongPathType" xml:space="preserve">
<value>You cannot get an ACL for the certificate provider path '{0}', only certificate items are supported.</value>
</data>
<data name="CannotSetAclWrongPathType" xml:space="preserve">
<value>You cannot set an ACL for the certificate provider path '{0}', only certificate items are supported.</value>
</data>
<data name="CannotGetAclWrongItemType" xml:space="preserve">
<value>You cannot get Certificate SecurityDescriptor for the type '{0}', only the 'Key' type is supported.</value>
</data>
<data name="GetKeyHandleAuthFailure" xml:space="preserve">
<value>Failed to retrieve certificate key handle due to access permissions: {0}</value>
</data>
<data name="GetKeyHandleMissingFailure" xml:space="preserve">
<value>Failed to retrieve certificate key handle as certificate has no associated key: {0}</value>
</data>
<data name="GetKeySDFailure" xml:space="preserve">
<value>Failed to retrieve certificate key security descriptor: {0}</value>
</data>
<data name="SetKeySDFailure" xml:space="preserve">
<value>Failed to set certificate key security descriptor: {0}</value>
</data>
</root>
Expand Up @@ -17,6 +17,7 @@
using System.Management.Automation.Provider;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.AccessControl;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text.RegularExpressions;
Expand Down Expand Up @@ -559,7 +560,9 @@ internal enum CertificateProviderItem
[OutputType(typeof(PathInfo), ProviderCmdlet = ProviderCmdlet.PopLocation)]
[OutputType(typeof(Microsoft.PowerShell.Commands.X509StoreLocation), typeof(X509Certificate2), ProviderCmdlet = ProviderCmdlet.GetItem)]
[OutputType(typeof(X509Store), typeof(X509Certificate2), ProviderCmdlet = ProviderCmdlet.GetChildItem)]
public sealed class CertificateProvider : NavigationCmdletProvider, ICmdletProviderSupportsHelp
[OutputType(typeof(CertificateKeySecurity), ProviderCmdlet = ProviderCmdlet.GetAcl)]
[OutputType(typeof(CertificateKeySecurity), ProviderCmdlet = ProviderCmdlet.SetAcl)]
public sealed partial class CertificateProvider : NavigationCmdletProvider, ICmdletProviderSupportsHelp, ISecurityDescriptorCmdletProvider
{
#region tracer

Expand Down