| | | 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 | | |
| | | 6 | | namespace CoreWCF.Security |
| | | 7 | | { |
| | | 8 | | public abstract class TrustVersion |
| | | 9 | | { |
| | 7 | 10 | | internal TrustVersion(XmlDictionaryString ns, XmlDictionaryString prefix) |
| | | 11 | | { |
| | 7 | 12 | | Namespace = ns; |
| | 7 | 13 | | Prefix = prefix; |
| | 7 | 14 | | } |
| | | 15 | | |
| | 0 | 16 | | public XmlDictionaryString Namespace { get; } |
| | | 17 | | |
| | 0 | 18 | | public XmlDictionaryString Prefix { get; } |
| | | 19 | | |
| | 4 | 20 | | public static TrustVersion Default => WSTrustFeb2005; |
| | | 21 | | |
| | 195 | 22 | | public static TrustVersion WSTrustFeb2005 => WSTrustVersionFeb2005.Instance; |
| | | 23 | | |
| | 229 | 24 | | public static TrustVersion WSTrust13 => WSTrustVersion13.Instance; |
| | | 25 | | |
| | | 26 | | private class WSTrustVersionFeb2005 : TrustVersion |
| | | 27 | | { |
| | 4 | 28 | | private static readonly WSTrustVersionFeb2005 s_instance = new WSTrustVersionFeb2005(); |
| | | 29 | | |
| | | 30 | | protected WSTrustVersionFeb2005() |
| | 4 | 31 | | : base(XD.TrustFeb2005Dictionary.Namespace, XD.TrustFeb2005Dictionary.Prefix) |
| | | 32 | | { |
| | 4 | 33 | | } |
| | | 34 | | |
| | 195 | 35 | | public static TrustVersion Instance => s_instance; |
| | | 36 | | } |
| | | 37 | | |
| | | 38 | | private class WSTrustVersion13 : TrustVersion |
| | | 39 | | { |
| | 3 | 40 | | private static readonly WSTrustVersion13 s_instance = new WSTrustVersion13(); |
| | | 41 | | |
| | | 42 | | protected WSTrustVersion13() |
| | 3 | 43 | | : base(DXD.TrustDec2005Dictionary.Namespace, DXD.TrustDec2005Dictionary.Prefix) |
| | | 44 | | { |
| | 3 | 45 | | } |
| | | 46 | | |
| | 229 | 47 | | public static TrustVersion Instance => s_instance; |
| | | 48 | | } |
| | | 49 | | } |
| | | 50 | | } |