This file contains hidden or 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 b = new CustomBinding(); | |
var sec = (AsymmetricSecurityBindingElement)SecurityBindingElement.CreateMutualCertificateBindingElement(MessageSecurityVersion.WSSecurity10WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10); | |
sec.EndpointSupportingTokenParameters.Signed.Add(new UserNameSecurityTokenParameters()); | |
sec.MessageSecurityVersion =MessageSecurityVersion. | |
WSSecurity10WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10; | |
sec.IncludeTimestamp = true; | |
sec.MessageProtectionOrder = System.ServiceModel.Security.MessageProtectionOrder.SignBeforeEncrypt; | |
sec.EnableUnsecuredResponse = true; | |
b.Elements.Add(sec); |
This file contains hidden or 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
public static void SignXmlFile(string FileName, string SignedFileName, RSA Key) | |
{ | |
// Create a new XML document. | |
XmlDocument doc = new XmlDocument(); | |
// Load the passed XML file using its name. | |
doc.Load(new XmlTextReader(FileName)); | |
// Create a SignedXml object. | |
SignedXml signedXml = new SignedXml(doc); |
This file contains hidden or 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
X509SecurityTokenParameters x509Params = new X509SecurityTokenParameters(); | |
x509Params.X509ReferenceStyle = | |
X509KeyIdentifierClauseType.SubjectKeyIdentifier; | |
x509Params.RequireDerivedKeys = false; | |
; | |
x509Params.InclusionMode = SecurityTokenInclusionMode.Never; | |
x509Params.ReferenceStyle = SecurityTokenReferenceStyle.Internal; | |
x509Params.X509ReferenceStyle = X509KeyIdentifierClauseType.Any; | |
((AsymmetricSecurityBindingElement) sec).InitiatorTokenParameters = x509Params; |
This file contains hidden or 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
public class ReplacePrefixMessageEncodingBindingElement : MessageEncodingBindingElement | |
{ | |
MessageEncodingBindingElement inner; | |
Dictionary<string, string> namespaceToPrefixMapping = new Dictionary<string, string>(); | |
public ReplacePrefixMessageEncodingBindingElement(MessageEncodingBindingElement inner) | |
{ | |
this.inner = inner; | |
} | |
private ReplacePrefixMessageEncodingBindingElement(ReplacePrefixMessageEncodingBindingElement other) |
This file contains hidden or 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
//git | |
cd C:\Users\naveh\Documents\features\projects\ws.js | |
use git as normal... | |
//npm | |
npm config set proxy http://localhost:8888/ | |
npm config set https-proxy http://localhost:8888/ | |
//and open fiddler | |
npm install -g nodeunit //in case not installed for some reason |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<system.serviceModel> | |
<bindings> | |
<customBinding> | |
<binding name="MHService_MHSPort"> | |
<!-- WsdlImporter encountered unrecognized policy assertions in ServiceDescription 'http://org/emedny/mhs/': --> | |
<!-- <wsdl:binding name='MHS'> --> | |
<!-- <dpe:summary xmlns:dpe="http://www.datapower.com/extensions">..</dpe:summary> --> | |
<!-- <sp:SupportingTokens xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">..</sp:SupportingTokens> --> |
This file contains hidden or 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
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mhs="http://org/emedny/mhs/" xmlns:urn="urn:hl7-org:v3"> | |
<soapenv:Header> | |
<wsse:Security soap:mustUnderstand="1" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> | |
<wsse:BinarySecurityToken ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-e00c8062-83d2-4f04-88fc-996218e7bb3d">MIICeDCC....(eMedNY signed user MLS cert).......</wsse:BinarySecurityToken> | |
<wsse:BinarySecurityToken ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-s |
This file contains hidden or 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
c.Endpoint.Contract.ProtectionLevel = System.Net.Security.ProtectionLevel.Sign; |
This file contains hidden or 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
http://wcfswaencoder.codeplex.com/ | |
http://www.codeplex.com/Download?ProjectName=wcfswaencoder&DownloadId=87250 | |
http://wcfswaencoder.codeplex.com/SourceControl/latest | |
public override Message ReadMessage(System.IO.Stream stream, int maxSizeOfHeaders, string contentType) | |
{ | |
VerifyOperationContext(); |
This file contains hidden or 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('xpath.js') | |
, dom = require('xmldom').DOMParser | |
var xml = "<?xml version='1.0' encoding='UTF-8'?>"+ | |
"<feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'>"+ | |
" <entry>"+ | |
" <updated>2014-08-19T14:37:34.663Z</updated>"+ | |
" <category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#spreadsheet'/>"+ | |
" <title type='text'>Tmp SS</title>"+ | |
" <content type='text'>Tmp SS</content>"+ |