added samples
[windows-sources.git] / sdk / samples / WCFSamples / TechnologySamples / Scenario / Federation / VB / Common / RequestSecurityTokenBase.vb
blobc8aa7e9ce079b18adfccdf3d7881fc3c407e8ac8
1 ' Copyright (c) Microsoft Corporation. All Rights Reserved.
3 Imports System
5 Imports System.Runtime.InteropServices
7 Imports System.ServiceModel
8 Imports System.ServiceModel.Channels
10 Namespace Microsoft.ServiceModel.Samples.Federation
12 ''' <summary>
13 ''' abstract base class containing properties that are shared by RST and RSTR classes
14 ''' </summary>
15 <ComVisible(False)> _
16 Public MustInherit Class RequestSecurityTokenBase
17 Inherits BodyWriter
19 ' private members
20 Private m_context As String
21 Private m_tokenType As String
22 Private m_keySize As Integer
23 Private m_appliesTo As EndpointAddress
25 ' Constructors
26 ''' <summary>
27 ''' Default constructor
28 ''' </summary>
29 Protected Sub New()
31 Me.New([String].Empty, [String].Empty, 0, Nothing)
33 End Sub
35 ''' <summary>
36 ''' Parameterized constructor
37 ''' </summary>
38 ''' <param name="context">The value of the wst:RequestSecurityToken/@Context attribute in the request message, if any</param>
39 ''' <param name="tokenType">The content of the wst:RequestSecurityToken/wst:TokenType element in the request message, if any</param>
40 ''' <param name="keySize">The content of the wst:RequestSecurityToken/wst:KeySize element in the request message, if any</param>
41 ''' <param name="appliesTo">An EndpointRefernece corresponding to the content of the wst:RequestSecurityToken/wsp:AppliesTo element in the request message, if any</param>
42 Protected Sub New(ByVal context As String, ByVal tokenType As String, ByVal keySize As Integer, ByVal appliesTo As EndpointAddress)
44 MyBase.New(True)
45 Me.m_context = context
46 Me.m_tokenType = tokenType
47 Me.m_keySize = keySize
48 Me.m_appliesTo = appliesTo
50 End Sub
52 ' public properties
54 ''' <summary>
55 ''' Context for the RST/RSTR exchange.
56 ''' The value of the wst:RequestSecurityToken/@Context attribute from RequestSecurityToken messages
57 ''' The value of the wst:RequestSecurityTokenResponse/@Context attribute from RequestSecurityTokenResponse messages
58 ''' </summary>
59 Public Property Context() As String
61 Get
63 Return m_context
65 End Get
66 Set(ByVal value As String)
68 m_context = value
70 End Set
72 End Property
74 ''' <summary>
75 ''' The type of token requested or returned.
76 ''' The value of the wst:RequestSecurityToken/wst:TokenType element from RequestSecurityToken messages
77 ''' The value of the wst:RequestSecurityTokenResponse/wst:TokenType element from RequestSecurityTokenResponse messages
78 ''' </summary>
79 Public Property TokenType() As String
81 Get
83 Return m_tokenType
85 End Get
86 Set(ByVal value As String)
88 m_tokenType = value
90 End Set
92 End Property
94 ''' <summary>
95 ''' The size of the requested proof key
96 ''' The value of the wst:RequestSecurityToken/wst:KeySize element from RequestSecurityToken messages
97 ''' The value of the wst:RequestSecurityTokenResponse/wst:KeySize element from RequestSecurityTokenResponse messages
98 ''' </summary>
99 Public Property KeySize() As Integer
103 Return m_keySize
105 End Get
106 Set(ByVal value As Integer)
108 m_keySize = value
110 End Set
112 End Property
114 ''' <summary>
115 ''' The EndpointAddress a token is being requested or returned for
116 ''' The content of the wst:RequestSecurityToken/wsp:AppliesTo element from RequestSecurityToken messages
117 ''' The content of the wst:RequestSecurityTokenResponse/wsp:AppliesTo element from RequestSecurityTokenResponse messages
118 ''' </summary>public int KeySize
119 Public Property AppliesTo() As EndpointAddress
123 Return m_appliesTo
125 End Get
126 Set(ByVal value As EndpointAddress)
128 m_appliesTo = value
130 End Set
132 End Property
134 End Class
136 End Namespace