| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System.Xml; |
| | | 5 | | using CoreWCF.Description; |
| | | 6 | | |
| | | 7 | | namespace CoreWCF.Security |
| | | 8 | | { |
| | | 9 | | internal class WSSecurityPolicy11 : WSSecurityPolicy |
| | | 10 | | { |
| | | 11 | | public const string WsspNamespace = @"http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"; |
| | | 12 | | |
| | | 13 | | public override string WsspNamespaceUri |
| | | 14 | | { |
| | 516 | 15 | | get { return WsspNamespace; } |
| | | 16 | | } |
| | | 17 | | |
| | | 18 | | public override bool IsSecurityVersionSupported(MessageSecurityVersion version) |
| | | 19 | | { |
| | 50 | 20 | | return version == MessageSecurityVersion.WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSe |
| | 50 | 21 | | version == MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecur |
| | 50 | 22 | | version == MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecur |
| | | 23 | | } |
| | | 24 | | |
| | | 25 | | public override TrustDriver TrustDriver |
| | | 26 | | { |
| | | 27 | | get |
| | | 28 | | { |
| | 0 | 29 | | return new WSTrustFeb2005.DriverFeb2005(new SecurityStandardsManager(MessageSecurityVersion.WSSecurity11 |
| | | 30 | | } |
| | | 31 | | } |
| | | 32 | | |
| | | 33 | | // WS-SecurityPolicy 11 should still use the mssp namespace for MustNotSendCancel |
| | | 34 | | public override XmlElement CreateWsspMustNotSendCancelAssertion(bool requireCancel) |
| | | 35 | | { |
| | 10 | 36 | | if (!requireCancel) |
| | | 37 | | { |
| | 0 | 38 | | XmlElement result = CreateMsspAssertion(MustNotSendCancelName); |
| | 0 | 39 | | return result; |
| | | 40 | | } |
| | | 41 | | else |
| | | 42 | | { |
| | 10 | 43 | | return null; |
| | | 44 | | } |
| | | 45 | | } |
| | | 46 | | |
| | | 47 | | public override XmlElement CreateWsspTrustAssertion(MetadataExporter exporter, SecurityKeyEntropyMode keyEntropy |
| | | 48 | | { |
| | 19 | 49 | | return CreateWsspTrustAssertion(Trust10Name, exporter, keyEntropyMode); |
| | | 50 | | } |
| | | 51 | | } |
| | | 52 | | } |