// Authors:
// Sebastien Pouliot <sebastien@ximian.com>
// Dick Porter <dick@ximian.com>
+// Atsushi Enomoto <atsushi@ximian.com>
+// James Bellinger <jfb@zer7.com>
//
-// Copyright (C) 2005, 2006 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2007 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2012 James Bellinger
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0
-
using System.Security.Principal;
-namespace System.Security.AccessControl {
- public sealed class CryptoKeySecurity : NativeObjectSecurity {
- CommonSecurityDescriptor securityDescriptor;
-
+namespace System.Security.AccessControl
+{
+ public sealed class CryptoKeySecurity : NativeObjectSecurity
+ {
public CryptoKeySecurity ()
+ : base (false, ResourceType.Unknown)
{
}
public CryptoKeySecurity (CommonSecurityDescriptor securityDescriptor)
+ : base (securityDescriptor, ResourceType.Unknown)
{
- this.securityDescriptor = securityDescriptor;
+
}
- public override Type AccessRightType
- {
- get {
- throw new NotImplementedException ();
- }
+ public override Type AccessRightType {
+ get { return typeof (CryptoKeyRights); }
}
- public override Type AccessRuleType
- {
- get {
- throw new NotImplementedException ();
- }
+ public override Type AccessRuleType {
+ get { return typeof (CryptoKeyAccessRule); }
}
- public override Type AuditRuleType
- {
- get {
- throw new NotImplementedException ();
- }
+ public override Type AuditRuleType {
+ get { return typeof (CryptoKeyAuditRule); }
}
- public override sealed AccessRule AccessRuleFactory (IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
+ public override sealed AccessRule AccessRuleFactory (IdentityReference identityReference, int accessMask,
+ bool isInherited, InheritanceFlags inheritanceFlags,
+ PropagationFlags propagationFlags, AccessControlType type)
{
- throw new NotImplementedException ();
+ return new CryptoKeyAccessRule (identityReference, (CryptoKeyRights) accessMask, type);
}
public void AddAccessRule (CryptoKeyAccessRule rule)
{
- throw new NotImplementedException ();
+ AddAccessRule ((AccessRule)rule);
}
- public void AddAuditRule (CryptoKeyAuditRule rule)
+ public bool RemoveAccessRule (CryptoKeyAccessRule rule)
{
- throw new NotImplementedException ();
+ return RemoveAccessRule ((AccessRule)rule);
}
- public override sealed AuditRule AuditRuleFactory (IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
+ public void RemoveAccessRuleAll (CryptoKeyAccessRule rule)
{
- throw new NotImplementedException ();
+ RemoveAccessRuleAll ((AccessRule)rule);
}
- public bool RemoveAccessRule (CryptoKeyAccessRule rule)
+ public void RemoveAccessRuleSpecific (CryptoKeyAccessRule rule)
{
- throw new NotImplementedException ();
+ RemoveAccessRuleSpecific ((AccessRule)rule);
}
- public void RemoveAccessRuleAll (CryptoKeyAccessRule rule)
+ public void ResetAccessRule (CryptoKeyAccessRule rule)
{
- throw new NotImplementedException ();
+ ResetAccessRule ((AccessRule)rule);
}
- public void RemoveAccessRuleSpecific (CryptoKeyAccessRule rule)
+ public void SetAccessRule (CryptoKeyAccessRule rule)
{
- throw new NotImplementedException ();
+ SetAccessRule ((AccessRule)rule);
}
- public bool RemoveAuditRule (CryptoKeyAuditRule rule)
+ public override sealed AuditRule AuditRuleFactory (IdentityReference identityReference, int accessMask,
+ bool isInherited, InheritanceFlags inheritanceFlags,
+ PropagationFlags propagationFlags, AuditFlags flags)
{
- throw new NotImplementedException ();
+ return new CryptoKeyAuditRule (identityReference, (CryptoKeyRights) accessMask, flags);
}
- public void RemoveAuditRuleAll (CryptoKeyAuditRule rule)
+ public void AddAuditRule (CryptoKeyAuditRule rule)
{
- throw new NotImplementedException ();
+ AddAuditRule ((AuditRule)rule);
}
- public void RemoveAuditRuleSpecific (CryptoKeyAuditRule rule)
+ public bool RemoveAuditRule (CryptoKeyAuditRule rule)
{
- throw new NotImplementedException ();
+ return RemoveAuditRule((AuditRule)rule);
}
- public void ResetAccessRule (CryptoKeyAccessRule rule)
+ public void RemoveAuditRuleAll (CryptoKeyAuditRule rule)
{
- throw new NotImplementedException ();
+ RemoveAuditRuleAll((AuditRule)rule);
}
- public void SetAccessRule (CryptoKeyAccessRule rule)
+ public void RemoveAuditRuleSpecific (CryptoKeyAuditRule rule)
{
- throw new NotImplementedException ();
+ RemoveAuditRuleSpecific((AuditRule)rule);
}
public void SetAuditRule (CryptoKeyAuditRule rule)
{
- throw new NotImplementedException ();
+ SetAuditRule((AuditRule)rule);
}
}
}
-#endif