Author: atsushi
Date: 2007-01-12 03:13:03 -0500 (Fri, 12 Jan 2007)
New Revision: 70903
Modified:
trunk/olive/class/System.ServiceModel/System.ServiceModel.Security/ChangeLog
trunk/olive/class/System.ServiceModel/System.ServiceModel.Security/WSSecurityTokenSerializer.cs
trunk/olive/class/System.ServiceModel/System.ServiceModel/ChangeLog
trunk/olive/class/System.ServiceModel/System.ServiceModel/Constants.cs
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Security/ChangeLog
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Security/WSSecurityTokenSerializerTest.cs
Log:
2007-01-12 Atsushi Enomoto <[EMAIL PROTECTED]>
* Constants.cs : added WSSEncryptedKeyToken.
* WSSecurityTokenSerializer.cs : handle WrappedKeySecurityToken in
GetTokenTypeUri().
* WSSecurityTokenSerializerTest.cs : added somewhat wrong test for
serialization for LocalIdKeyIdentifierClause with OwnerType.
Modified: trunk/olive/class/System.ServiceModel/System.ServiceModel/ChangeLog
===================================================================
--- trunk/olive/class/System.ServiceModel/System.ServiceModel/ChangeLog
2007-01-12 08:09:57 UTC (rev 70902)
+++ trunk/olive/class/System.ServiceModel/System.ServiceModel/ChangeLog
2007-01-12 08:13:03 UTC (rev 70903)
@@ -1,3 +1,7 @@
+2007-01-12 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * Constants.cs : added WSSEncryptedKeyToken.
+
2007-01-10 Atsushi Enomoto <[EMAIL PROTECTED]>
* Constants.cs : added WssBase64BinaryEncodingType (but I cannot
Modified: trunk/olive/class/System.ServiceModel/System.ServiceModel/Constants.cs
===================================================================
--- trunk/olive/class/System.ServiceModel/System.ServiceModel/Constants.cs
2007-01-12 08:09:57 UTC (rev 70902)
+++ trunk/olive/class/System.ServiceModel/System.ServiceModel/Constants.cs
2007-01-12 08:13:03 UTC (rev 70903)
@@ -53,6 +53,8 @@
public const string WSSKerberosToken =
"http://docs.oasis-open.org/wss/oasis-wss-kerberos-token-profile-1.1#GSS_Kerberosv5_AP_REQ";
+ public const string WSSEncryptedKeyToken =
"http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey";
+
public const string WstNamespace =
"http://schemas.xmlsoap.org/ws/2005/02/trust";
public const string WssNamespace =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
public const string WspNamespace =
"http://schemas.xmlsoap.org/ws/2004/09/policy";
Modified:
trunk/olive/class/System.ServiceModel/System.ServiceModel.Security/ChangeLog
===================================================================
---
trunk/olive/class/System.ServiceModel/System.ServiceModel.Security/ChangeLog
2007-01-12 08:09:57 UTC (rev 70902)
+++
trunk/olive/class/System.ServiceModel/System.ServiceModel.Security/ChangeLog
2007-01-12 08:13:03 UTC (rev 70903)
@@ -1,3 +1,8 @@
+2007-01-12 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * WSSecurityTokenSerializer.cs : handle WrappedKeySecurityToken in
+ GetTokenTypeUri().
+
2007-01-11 Atsushi Enomoto <[EMAIL PROTECTED]>
* WSSecurityTokenSerializer.cs : add e:ReferenceList output.
Modified:
trunk/olive/class/System.ServiceModel/System.ServiceModel.Security/WSSecurityTokenSerializer.cs
===================================================================
---
trunk/olive/class/System.ServiceModel/System.ServiceModel.Security/WSSecurityTokenSerializer.cs
2007-01-12 08:09:57 UTC (rev 70902)
+++
trunk/olive/class/System.ServiceModel/System.ServiceModel.Security/WSSecurityTokenSerializer.cs
2007-01-12 08:13:03 UTC (rev 70903)
@@ -148,6 +148,8 @@
protected virtual string GetTokenTypeUri (Type tokenType)
{
+ if (tokenType == typeof (WrappedKeySecurityToken))
+ return Constants.WSSEncryptedKeyToken;
if (tokenType == typeof (X509SecurityToken))
return Constants.WSSX509Token;
// if (tokenType == typeof (RsaSecurityToken))
@@ -429,6 +431,9 @@
{
w.WriteStartElement ("o", "SecurityTokenReference",
Constants.WssNamespace);
w.WriteStartElement ("o", "Reference",
Constants.WssNamespace);
+ string valueType = ic.OwnerType != null ?
GetTokenTypeUri (ic.OwnerType) : null;
+ if (valueType != null)
+ w.WriteAttributeString ("ValueType", valueType);
w.WriteAttributeString ("URI", "#" + ic.LocalId);
w.WriteEndElement ();
w.WriteEndElement ();
Modified:
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Security/ChangeLog
===================================================================
---
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Security/ChangeLog
2007-01-12 08:09:57 UTC (rev 70902)
+++
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Security/ChangeLog
2007-01-12 08:13:03 UTC (rev 70903)
@@ -1,3 +1,8 @@
+2007-01-12 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * WSSecurityTokenSerializerTest.cs : added somewhat wrong test for
+ serialization for LocalIdKeyIdentifierClause with OwnerType.
+
2007-01-11 Atsushi Enomoto <[EMAIL PROTECTED]>
* WSSecurityTokenSerializerTest.cs : some tests for
Modified:
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Security/WSSecurityTokenSerializerTest.cs
===================================================================
---
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Security/WSSecurityTokenSerializerTest.cs
2007-01-12 08:09:57 UTC (rev 70902)
+++
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Security/WSSecurityTokenSerializerTest.cs
2007-01-12 08:13:03 UTC (rev 70903)
@@ -296,6 +296,18 @@
}
[Test]
+ [Category ("NotWorking")] // I believe it should output
ValueType attribute, but .net does not.
+ public void WriteLocalIdKeyIdentifierClause3 ()
+ {
+ StringWriter sw = new StringWriter ();
+ LocalIdKeyIdentifierClause ic = new
LocalIdKeyIdentifierClause ("urn:myIDValue", typeof (WrappedKeySecurityToken));
+ using (XmlWriter w = XmlWriter.Create (sw,
GetWriterSettings ())) {
+
WSSecurityTokenSerializer.DefaultInstance.WriteKeyIdentifierClause (w, ic);
+ }
+ Assert.AreEqual ("<o:SecurityTokenReference
xmlns:o=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><o:Reference
URI=\"#urn:myIDValue\" /></o:SecurityTokenReference>", sw.ToString (), "#1");
+ }
+
+ [Test]
public void ReadKeyIdentifierClause ()
{
string xml = @"<o:SecurityTokenReference
xmlns:o='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'>
@@ -461,6 +473,8 @@
Assert.IsNull (GetTokenTypeUri (typeof
(GenericXmlSecurityToken)), "#8");
Assert.AreEqual
("http://docs.oasis-open.org/wss/oasis-wss-kerberos-token-profile-1.1#GSS_Kerberosv5_AP_REQ",
GetTokenTypeUri (typeof
(KerberosRequestorSecurityToken)), "#9");
+ Assert.AreEqual
("http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey",
+ GetTokenTypeUri (typeof
(WrappedKeySecurityToken)), "#10");
}
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches