| | | 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 SecureConversationVersion |
| | | 9 | | { |
| | 7 | 10 | | internal SecureConversationVersion(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 | | |
| | | 20 | | public static SecureConversationVersion Default |
| | | 21 | | { |
| | 4 | 22 | | get { return WSSecureConversationFeb2005; } |
| | | 23 | | } |
| | | 24 | | |
| | | 25 | | public static SecureConversationVersion WSSecureConversationFeb2005 |
| | | 26 | | { |
| | 277 | 27 | | get { return WSSecureConversationVersionFeb2005.Instance; } |
| | | 28 | | } |
| | | 29 | | |
| | | 30 | | public static SecureConversationVersion WSSecureConversation13 |
| | | 31 | | { |
| | 276 | 32 | | get { return WSSecureConversationVersion13.Instance; } |
| | | 33 | | } |
| | | 34 | | |
| | | 35 | | private class WSSecureConversationVersionFeb2005 : SecureConversationVersion |
| | | 36 | | { |
| | 4 | 37 | | private static readonly WSSecureConversationVersionFeb2005 s_instance = new WSSecureConversationVersionFeb20 |
| | | 38 | | |
| | | 39 | | protected WSSecureConversationVersionFeb2005() |
| | 4 | 40 | | : base(XD.SecureConversationFeb2005Dictionary.Namespace, XD.SecureConversationFeb2005Dictionary.Prefix) |
| | | 41 | | { |
| | 4 | 42 | | } |
| | | 43 | | |
| | | 44 | | public static SecureConversationVersion Instance |
| | | 45 | | { |
| | | 46 | | get |
| | | 47 | | { |
| | 277 | 48 | | return s_instance; |
| | | 49 | | } |
| | | 50 | | } |
| | | 51 | | } |
| | | 52 | | |
| | | 53 | | private class WSSecureConversationVersion13 : SecureConversationVersion |
| | | 54 | | { |
| | 3 | 55 | | private static readonly WSSecureConversationVersion13 s_instance = new WSSecureConversationVersion13(); |
| | | 56 | | |
| | | 57 | | protected WSSecureConversationVersion13() |
| | 3 | 58 | | : base(DXD.SecureConversationDec2005Dictionary.Namespace, DXD.SecureConversationDec2005Dictionary.Prefix |
| | | 59 | | { |
| | 3 | 60 | | } |
| | | 61 | | |
| | | 62 | | public static SecureConversationVersion Instance |
| | | 63 | | { |
| | | 64 | | get |
| | | 65 | | { |
| | 276 | 66 | | return s_instance; |
| | | 67 | | } |
| | | 68 | | } |
| | | 69 | | } |
| | | 70 | | } |
| | | 71 | | } |