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 ms = new MemoryStream(secureEnvelopeBytes); | |
var xRdr = new XmlTextReader(ms); | |
var message = Message.CreateMessage(xRdr, int.MaxValue, MessageVersion.Soap12); | |
var securityHeader = message.Headers.FirstOrDefault(x => x.Name == "Security"); | |
if (securityHeader != null) | |
{ | |
var securityElement = XElement.Parse(securityHeader.ToString()); | |
var binarySecurityToken = securityElement.Descendants( | |
XName.Get("BinarySecurityToken", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")).Single(); |
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
#requires -version 2.0 | |
Add-Type @" | |
public class Shift { | |
public static int Right(int x, int count) { return x >> count; } | |
public static uint Right(uint x, int count) { return x >> count; } | |
public static long Right(long x, int count) { return x >> count; } | |
public static ulong Right(ulong x, int count) { return x >> count; } | |
public static int Left(int x, int count) { return x << count; } | |
public static uint Left(uint x, int count) { return x << count; } | |
public static long Left(long x, int count) { return x << count; } |
NewerOlder