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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace ThinkOfTheChildren | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ |
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
(define (equal? a b) | |
(or (and | |
(not (pair? a)) | |
(not (pair? b)) | |
(eq? a b)) | |
(and | |
(pair? a) | |
(pair? b) | |
(equal? (car a) (car b)) | |
(equal? (cdr a) (cdr b))))) |
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
(define (timed-prime-test n) | |
(newline) | |
(display n) | |
(let-values ([(result-list t real gc) | |
(time-apply prime? (list n))]) | |
(cond ((car result-list) | |
(display " *** ") | |
(display real))))) |
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
#lang racket | |
(define (square x) (* x x)) | |
(define (sum-square x y) | |
(+ (square x) (square y))) | |
(define (min x y) | |
(if (< x y) x y)) |
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
using System; | |
using System.Text; | |
using System.ServiceModel.Channels; | |
using System.Xml; | |
using System.IO; | |
using System.Security.Cryptography; | |
using System.Resources; | |
using System.Security.Cryptography.X509Certificates; | |
namespace eMedNySOAPClient |
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
using System.ServiceModel.Channels; | |
namespace eMedNySOAPClient | |
{ | |
public class CustomTextMessageEncoderFactory : MessageEncoderFactory | |
{ | |
private MessageEncoder encoder; | |
internal CustomTextMessageEncoderFactory(string contentType, MessageVersion msgVersion) | |
{ |
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
using System; | |
using System.ServiceModel.Channels; | |
using System.Xml; | |
namespace eMedNySOAPClient | |
{ | |
public class CustomTextMessageBindingElement : MessageEncodingBindingElement | |
{ | |
private MessageVersion msgVersion; | |
private string mediaType; |
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
Unhandled Exception: System.ServiceModel.Security.SecurityNegotiationException: Could not establish | |
trust relationship for the SSL/TLS secure channel with authority 'service01.emedny.org:7602'. | |
---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> |
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
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> | |
<s:Header> | |
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> | |
<o:BinarySecurityToken u:Id="uuid-604c12aa-1a76-4f40-b7e3-57857b596549-3" 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"> | |
MIICL...(USER CERTIFICATE)...lmdGpDz8gbg646R5gzebF1waazrrVM=</o:BinarySecurityToken> | |
<e:EncryptedKey Id="_0" xmlns:e="http://www.w3.org/2001/04/xmlenc#"> | |
<e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/> | |
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> | |
<o:SecurityTokenReference> | |
<o:KeyIde |
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
AsymmetricSecurityBindingElement sec; | |
sec = (AsymmetricSecurityBindingElement) SecurityBindingElement.CreateMutualCertificateBindingElement( | |
MessageSecurityVersion.WSSecurity10WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10); | |
sec.DefaultAlgorithmSuite = SecurityAlgorithmSuite.TripleDesRsa15; | |
sec.IncludeTimestamp = false; | |
sec.AllowSerializedSigningTokenOnReply = true; | |
sec.MessageProtectionOrder = MessageProtectionOrder.SignBeforeEncrypt; | |
sec.EndpointSupportingTokenParameters.Signed.Add( new UserNameSecurityTokenParameters( )); |
NewerOlder