This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Main(string[] args) | |
{ | |
using (ServiceHost host = new ServiceHost(typeof(Service))) | |
{ | |
host.Description.Behaviors.Add(new ServiceMetadataBehavior() { | |
HttpGetEnabled = true, | |
HttpGetUrl = new System.Uri("http://localhost:7171/")}); | |
var ep = host.AddServiceEndpoint("IService", new BasicHttpBinding(), | |
"http://localhost:7171/"); | |
ep.Behaviors.Add(new MyWsdlExporter()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> | |
<SignedInfo> | |
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> | |
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> | |
<Reference URI="#_0"> | |
<Transforms> | |
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> | |
</Transforms> | |
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> | |
<DigestValue>b5GCZ2xpP5T7tbLWBTkOl4CYupQ=</DigestValue> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SignedXml = require('xml-crypto').SignedXml | |
, FileKeyInfo = require('xml-crypto').FileKeyInfo | |
, fs = require('fs') | |
var xml = "<library>" + | |
"<book>" + | |
"<name>Harry Potter</name>" + | |
"</book>" | |
"</library>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<library> | |
<book Id="_0"> | |
<name>Harry Potter</name> | |
</book> | |
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> | |
<SignedInfo> | |
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> | |
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> | |
<Reference URI="#_0"> | |
<Transforms> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var select = require('xml-crypto').xpath.SelectNodes | |
, dom = require('xmldom').DOMParser | |
, SignedXml = require('xml-crypto').SignedXml | |
, FileKeyInfo = require('xml-crypto').FileKeyInfo | |
, fs = require('fs') | |
var xml = fs.readFileSync("signed.xml").toString() | |
var doc = new dom().parseFromString(xml) | |
var signature = select(doc, "/*/*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']")[0] | |
var sig = new SignedXml() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<customBinding> | |
<binding name="NewBinding0"> | |
<textMessageEncoding /> | |
<security authenticationMode="MutualCertificate" | |
messageSecurityVersion="WSSecurity10..."> | |
<secureConversationBootstrap /> | |
</security> | |
<httpTransport /> | |
</binding> | |
</customBinding> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<wsHttpBinding> | |
<binding name="NewBinding1"> | |
<security> | |
<message clientCredentialType="Certificate" /> | |
</security> | |
</binding> | |
</wsHttpBinding> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ServiceBehavior(ProtectionLevel=ProtectionLevel.SignOnly)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" ... > | |
<Header> | |
<ws:Action>http://tempuri.org/IService/GetData</ws:Action> | |
<ws:To>http://localhost:8888/</ws:To> | |
<ws:MessageID>ca62b7d7-4f74-75ed-9f5c-b09b173f6747</ws:MessageID> | |
<ws:ReplyTo> | |
<ws:Address>...</ws:Address> | |
</ws:ReplyTo> | |
<o:Security> | |
<u:Timestamp xmlns:wsu="..." wsu:Id="_1"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var wcf = require('wcf.js') | |
, fs = require("fs") | |
, TextMessageEncodingBindingElement = wcf.TextMessageEncodingBindingElement | |
, HttpTransportBindingElement = wcf.HttpTransportBindingElement | |
, SecurityBindingElement = wcf.SecurityBindingElement | |
, CustomBinding = wcf.CustomBinding | |
, Proxy = wcf.Proxy | |
var binding = new CustomBinding( | |
[ new SecurityBindingElement({AuthenticationMode: "MutualCertificate"}) |