فهرست منبع

2010-01-18 Atsushi Enomoto <[email protected]>

	* SecureConversationVersion.cs, SecurityPolicyVersion.cs,
	  TrustVersion.cs : add new 3.5 classes.

	* MessageSecurityVersion.cs : add new 3.5 members.

	* System.ServiceModel.dll.sources : added new security version types.


svn path=/trunk/mcs/; revision=149724
Atsushi Eno 16 سال پیش
والد
کامیت
ced694017c

+ 4 - 0
mcs/class/System.ServiceModel/ChangeLog

@@ -1,3 +1,7 @@
+2010-01-18  Astushi Enomoto  <[email protected]>
+
+	* System.ServiceModel.dll.sources : added new security version types.
+
 2010-01-15  Astushi Enomoto  <[email protected]>
 
 	* System.ServiceModel.dll.sources: add SL config loader here

+ 5 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Security/ChangeLog

@@ -1,3 +1,8 @@
+2010-01-18  Atsushi Enomoto  <[email protected]>
+
+	* SecureConversationVersion.cs, SecurityPolicyVersion.cs,
+	  TrustVersion.cs : add new 3.5 classes.
+
 2007-04-17  Atsushi Enomoto  <[email protected]>
 
 	* WSSecurityTokenSerializer.cs : write GenericXmlSecurityToken (btw

+ 54 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Security/SecureConversationVersion.cs

@@ -0,0 +1,54 @@
+//
+// SecureConversationVersion.cs
+//
+// Author:
+//	Atsushi Enomoto <[email protected]>
+//
+// Copyright (C) 2010 Novell, Inc.  http://www.novell.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System.Xml;
+
+namespace System.ServiceModel.Security
+{
+	public abstract class SecureConversationVersion
+	{
+		static SecureConversationVersion ()
+		{
+			var dic = new XmlDictionary ();
+			WSSecureConversation13 = new SecureConversationVersionImpl () { Prefix = dic.Add ("wsse"), Namespace = dic.Add ("http://schemas.xmlsoap.org/ws/2002/12/secext") };
+			WSSecureConversationFeb2005 = new SecureConversationVersionImpl () { Prefix = dic.Add ("wsse"), Namespace = dic.Add ("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd") };
+			Default = WSSecureConversation13;
+		}
+
+		public static SecureConversationVersion Default { get; private set; }
+
+		public static SecureConversationVersion WSSecureConversation13 { get; private set; }
+		public static SecureConversationVersion WSSecureConversationFeb2005 { get; private set; }
+
+		public XmlDictionaryString Namespace { get; internal set; }
+		public XmlDictionaryString Prefix { get; internal set; }
+	}
+
+	class SecureConversationVersionImpl : SecureConversationVersion
+	{
+	}
+}

+ 49 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Security/SecurityPolicyVersion.cs

@@ -0,0 +1,49 @@
+//
+// SecurityPolicyVersion.cs
+//
+// Author:
+//	Atsushi Enomoto <[email protected]>
+//
+// Copyright (C) 2010 Novell, Inc.  http://www.novell.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.ServiceModel.Security
+{
+	public abstract class SecurityPolicyVersion
+	{
+		static SecurityPolicyVersion ()
+		{
+			WSSecurityPolicy11 = new SecurityPolicyVersionImpl () { Prefix = "wsp", Namespace = "http://schemas.xmlsoap.org/ws/2004/09/policy" };
+			WSSecurityPolicy12 = new SecurityPolicyVersionImpl () { Prefix = "wsp", Namespace = "http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" };
+		}
+
+		public static SecurityPolicyVersion WSSecurityPolicy11 { get; private set; }
+		public static SecurityPolicyVersion WSSecurityPolicy12 { get; private set; }
+
+		public string Namespace { get; internal set; }
+		public string Prefix { get; internal set; }
+	}
+
+	class SecurityPolicyVersionImpl : SecurityPolicyVersion
+	{
+	}
+}

+ 53 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Security/TrustVersion.cs

@@ -0,0 +1,53 @@
+//
+// TrustVersion.cs
+//
+// Author:
+//	Atsushi Enomoto <[email protected]>
+//
+// Copyright (C) 2010 Novell, Inc.  http://www.novell.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System.Xml;
+
+namespace System.ServiceModel.Security
+{
+	public abstract class TrustVersion
+	{
+		static TrustVersion ()
+		{
+			var dic = new XmlDictionary ();
+			WSTrust13 = new TrustVersionImpl () { Prefix = dic.Add ("wst"), Namespace = dic.Add ("http://docs.oasis-open.org/ws-sx/ws-trust/200512") };
+			WSTrustFeb2005 = new TrustVersionImpl () { Prefix = dic.Add ("wsse"), Namespace = dic.Add ("http://schemas.xmlsoap.org/ws/2002/12/secext") };
+			Default = WSTrust13;
+		}
+
+		public static TrustVersion Default { get; private set; }
+		public static TrustVersion WSTrust13 { get; private set; }
+		public static TrustVersion WSTrustFeb2005 { get; private set; }
+
+		public XmlDictionaryString Namespace { get; internal set; }
+		public XmlDictionaryString Prefix { get; internal set; }
+	}
+
+	class TrustVersionImpl : TrustVersion
+	{
+	}
+}

+ 3 - 0
mcs/class/System.ServiceModel/System.ServiceModel.dll.sources

@@ -763,12 +763,14 @@ System.ServiceModel.Security/MessageSecurityException.cs
 System.ServiceModel.Security/PeerCredential.cs
 System.ServiceModel.Security/ScopedMessagePartSpecification.cs
 System.ServiceModel.Security/SecureConversationServiceCredential.cs
+System.ServiceModel.Security/SecureConversationVersion.cs
 System.ServiceModel.Security/SecurityAccessDeniedException.cs
 System.ServiceModel.Security/SecurityAlgorithmSuite.cs
 System.ServiceModel.Security/SecurityContextKeyIdentifierClause.cs
 System.ServiceModel.Security/SecurityCredentialsManager.cs
 System.ServiceModel.Security/SecurityMessageProperty.cs
 System.ServiceModel.Security/SecurityNegotiationException.cs
+System.ServiceModel.Security/SecurityPolicyVersion.cs
 System.ServiceModel.Security/SecurityStateEncoder.cs
 System.ServiceModel.Security/SecurityTokenAttachmentMode.cs
 System.ServiceModel.Security/SecurityTokenSpecification.cs
@@ -776,6 +778,7 @@ System.ServiceModel.Security/SecurityVersion.cs
 System.ServiceModel.Security/ServiceCredentialsSecurityTokenManager.cs
 System.ServiceModel.Security/SspiSecurityTokenProvider.cs
 System.ServiceModel.Security/SupportingTokenSpecification.cs
+System.ServiceModel.Security/TrustVersion.cs
 System.ServiceModel.Security/UnionSecurityTokenResolver.cs
 System.ServiceModel.Security/UserNamePasswordClientCredential.cs
 System.ServiceModel.Security/UserNamePasswordServiceCredential.cs

+ 4 - 0
mcs/class/System.ServiceModel/System.ServiceModel/ChangeLog

@@ -1,3 +1,7 @@
+2010-01-18  Atsushi Enomoto  <[email protected]>
+
+	* MessageSecurityVersion.cs : add new 3.5 members.
+
 2010-01-15  Atsushi Enomoto  <[email protected]>
 
 	* SilverlightClientConfigLoader.cs : add another loop blocker.

+ 40 - 6
mcs/class/System.ServiceModel/System.ServiceModel/MessageSecurityVersion.cs

@@ -98,12 +98,20 @@ namespace System.ServiceModel
 
 		class MessageSecurityVersionImpl : MessageSecurityVersion
 		{
-			bool wss11, basic_profile;
+			bool wss11, basic_profile, use2007;
 
-			public MessageSecurityVersionImpl (bool wss11, bool basicProfile)
+			public MessageSecurityVersionImpl (bool wss11, bool basicProfile, bool use2007)
 			{
 				this.wss11 = wss11;
 				this.basic_profile = basicProfile;
+				this.use2007 = use2007;
+				if (use2007) {
+					SecureConversationVersion = SecureConversationVersion.Default;
+					TrustVersion = TrustVersion.Default;
+				} else {
+					SecureConversationVersion = SecureConversationVersion.WSSecureConversationFeb2005;
+					TrustVersion = TrustVersion.WSTrustFeb2005;
+				}
 			}
 
 			public override BasicSecurityProfileVersion BasicSecurityProfileVersion {
@@ -117,17 +125,24 @@ namespace System.ServiceModel
 			public override SecurityVersion SecurityVersion {
 				get { return wss11 ? SecurityVersion.WSSecurity11 : SecurityVersion.WSSecurity10; }
 			}
+
+			public override SecurityPolicyVersion SecurityPolicyVersion {
+				get { return use2007 ? SecurityPolicyVersion.WSSecurityPolicy12 : SecurityPolicyVersion.WSSecurityPolicy11; }
+			}
 		}
 
 		// Static members
 
-		static MessageSecurityVersion wss10_basic, wss11, wss11_basic;
+		static MessageSecurityVersion wss10_basic, wss11, wss11_basic, wss10_2007_basic, wss11_2007_basic, wss11_2007;
 
 		static MessageSecurityVersion ()
 		{
-			wss10_basic = new MessageSecurityVersionImpl (false, true);
-			wss11 = new MessageSecurityVersionImpl (true, false);
-			wss11_basic = new MessageSecurityVersionImpl (true, true);
+			wss10_basic = new MessageSecurityVersionImpl (false, true, false);
+			wss11 = new MessageSecurityVersionImpl (true, false, false);
+			wss11_basic = new MessageSecurityVersionImpl (true, true, false);
+			wss10_2007_basic = new MessageSecurityVersionImpl (false, true, true);
+			wss11_2007_basic = new MessageSecurityVersionImpl (true, true, true);
+			wss11_2007 = new MessageSecurityVersionImpl (true, false, true);
 		}
 
 		public static MessageSecurityVersion Default {
@@ -148,6 +163,18 @@ namespace System.ServiceModel
 			get { return wss11_basic; }
 		}
 
+		public static MessageSecurityVersion WSSecurity10WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10 {
+			get { return wss10_2007_basic; }
+		}
+
+		public static MessageSecurityVersion WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10 {
+			get { return wss11_2007_basic; }
+		}
+
+		public static MessageSecurityVersion WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12 {
+			get { return wss11_2007; }
+		}
+
 		// Instance members
 
 		MessageSecurityVersion ()
@@ -159,5 +186,12 @@ namespace System.ServiceModel
 		public abstract SecurityTokenVersion SecurityTokenVersion { get; }
 
 		public abstract SecurityVersion SecurityVersion { get; }
+
+		public SecureConversationVersion SecureConversationVersion { get; internal set; }
+
+		public abstract SecurityPolicyVersion SecurityPolicyVersion { get; }
+
+		public TrustVersion TrustVersion { get; internal set; }
+
 	}
 }