Author: atsushi
Date: 2007-04-04 06:18:04 -0400 (Wed, 04 Apr 2007)
New Revision: 75379

Added:
   trunk/olive/samples/services/cardspace/
   trunk/olive/samples/services/cardspace/ChangeLog
   trunk/olive/samples/services/cardspace/Makefile
   trunk/olive/samples/services/cardspace/gettoken.cs
   trunk/olive/samples/services/cardspace/import.cs
   trunk/olive/samples/services/cardspace/manage.cs
   trunk/olive/samples/services/cardspace/test.cer
Log:
2007-04-04  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * manage.cs, import.cs, gettoken.cs, test.cer : initial checkin.
          gettoken.exe is still not working yet ...



Added: trunk/olive/samples/services/cardspace/ChangeLog
===================================================================
--- trunk/olive/samples/services/cardspace/ChangeLog    2007-04-04 10:11:15 UTC 
(rev 75378)
+++ trunk/olive/samples/services/cardspace/ChangeLog    2007-04-04 10:18:04 UTC 
(rev 75379)
@@ -0,0 +1,5 @@
+2007-04-04  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * manage.cs, import.cs, gettoken.cs, test.cer : initial checkin.
+         gettoken.exe is still not working yet ...
+

Added: trunk/olive/samples/services/cardspace/Makefile
===================================================================
--- trunk/olive/samples/services/cardspace/Makefile     2007-04-04 10:11:15 UTC 
(rev 75378)
+++ trunk/olive/samples/services/cardspace/Makefile     2007-04-04 10:18:04 UTC 
(rev 75379)
@@ -0,0 +1,14 @@
+all: manage.exe import.exe gettoken.exe
+
+manage.exe : manage.cs
+       gmcs -pkg:olive manage.cs
+
+import.exe : import.cs
+       gmcs -pkg:olive import.cs
+
+gettoken.exe : gettoken.cs
+       gmcs -pkg:olive gettoken.cs
+
+clean:
+       rm -rf manage.exe import.exe gettoken.exe
+

Added: trunk/olive/samples/services/cardspace/gettoken.cs
===================================================================
--- trunk/olive/samples/services/cardspace/gettoken.cs  2007-04-04 10:11:15 UTC 
(rev 75378)
+++ trunk/olive/samples/services/cardspace/gettoken.cs  2007-04-04 10:18:04 UTC 
(rev 75379)
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IdentityModel.Claims;
+using System.IdentityModel.Selectors;
+using System.Security.Cryptography.X509Certificates;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Security;
+using System.Xml;
+using System.Xml.Serialization;
+
+public class Test
+{
+       public static void Main ()
+       {
+               XmlDocument doc = new XmlDocument ();
+               doc.AppendChild (doc.CreateElement ("root"));
+               X509Certificate2 cert = new X509Certificate2 ("test.cer");
+               using (XmlWriter w = doc.DocumentElement.CreateNavigator 
().AppendChild ()) {
+                       new EndpointAddress (new Uri ("http://localhost:8080";),
+                               new X509CertificateEndpointIdentity (cert))
+                               .WriteTo (AddressingVersion.WSAddressing10, w);
+               }
+               XmlElement endpoint = doc.DocumentElement.FirstChild as 
XmlElement;
+               using (XmlWriter w = doc.DocumentElement.CreateNavigator 
().AppendChild ()) {
+                       new EndpointAddress (new Uri ("http://localhost:9090";),
+                               new X509CertificateEndpointIdentity (cert))
+                               .WriteTo (AddressingVersion.WSAddressing10, w);
+
+               }
+               string wst = "http://schemas.xmlsoap.org/ws/2005/02/trust";;
+               string infocard = 
"http://schemas.xmlsoap.org/ws/2005/05/identity";;
+               XmlElement p = doc.CreateElement ("Claims", wst);
+               p.SetAttribute ("Dialect", ClaimTypes.Name);
+               p.AppendChild (doc.CreateElement ("Name", infocard));
+               XmlElement issuer = doc.DocumentElement.LastChild as XmlElement;
+               CardSpaceSelector.GetToken (endpoint, new XmlElement [] 
{p.FirstChild as XmlElement},
+                       issuer, WSSecurityTokenSerializer.DefaultInstance);
+       }
+}
+

Added: trunk/olive/samples/services/cardspace/import.cs
===================================================================
--- trunk/olive/samples/services/cardspace/import.cs    2007-04-04 10:11:15 UTC 
(rev 75378)
+++ trunk/olive/samples/services/cardspace/import.cs    2007-04-04 10:18:04 UTC 
(rev 75379)
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IdentityModel.Selectors;
+using System.Xml;
+
+public class Test
+{
+       public static void Main (string [] args)
+       {
+               CardSpaceSelector.Import (args [0]);
+       }
+}
+

Added: trunk/olive/samples/services/cardspace/manage.cs
===================================================================
--- trunk/olive/samples/services/cardspace/manage.cs    2007-04-04 10:11:15 UTC 
(rev 75378)
+++ trunk/olive/samples/services/cardspace/manage.cs    2007-04-04 10:18:04 UTC 
(rev 75379)
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IdentityModel.Selectors;
+using System.Xml;
+
+public class Test
+{
+       public static void Main ()
+       {
+               CardSpaceSelector.Manage ();
+       }
+}
+

Added: trunk/olive/samples/services/cardspace/test.cer
===================================================================
--- trunk/olive/samples/services/cardspace/test.cer     2007-04-04 10:11:15 UTC 
(rev 75378)
+++ trunk/olive/samples/services/cardspace/test.cer     2007-04-04 10:18:04 UTC 
(rev 75379)
@@ -0,0 +1,12 @@
+-----BEGIN CERTIFICATE-----
+MIIBxTCCAS6gAwIBAgIQdpYkgiI1/kOLutzrMY5i1DANBgkqhkiG9w0BAQUFADAg
+MR4wHAYDVQQDExVNb25vIFRlc3QgUm9vdCBBZ2VuY3kwHhcNMDYwNzIxMDYzODUz
+WhcNMzkxMjMxMDk1OTU5WjAkMSIwIAYDVQQDExlQb3Vwb3Uncy1Tb2Z0d2FyZS1G
+YWN0b3J5MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDSD0FU/Ymimao4JYiq
+VsgMYCVM1iRrfWtQwJ1/qUMfGj8GgmXyBcGxUz/cjpkn5n/TlzNVanjnNRYJS0FZ
+ifd4AbRnA3kON3R+YHKjWwzPqwoFHA7UQgRrrR7/QmuHOlXBPDOd/SgKjRtz6uWN
+2er0nYkwJyp/ihUktx1PLu7CWQIBETANBgkqhkiG9w0BAQUFAAOBgQCJzIlI/aUc
+M6/KHi6pgBJ77YbUcTXAlVFF7IPvOcVggC+OTXiRGK4tw5Q76QJK86HBE4QdUOd0
+1eASPfJwCFNCq3X8g0bWRAukny8YON7XcLNP3psXRvNp2rudvSFJr51Eq1XtngZH
+MPDAFYCl4cBXvnlQZBwaHaWMGgngRCKnNA==
+-----END CERTIFICATE-----

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to