1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
|
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
namespace System.IdentityModel
{
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens;
/// <summary>
/// Defines one class which contains all the relying party related information.
/// This class is not thread safe.
/// </summary>
public class Scope
{
string _appliesToAddress;
string _replyToAddress;
EncryptingCredentials _encryptingCredentials;
SigningCredentials _signingCredentials;
bool _symmetricKeyEncryptionRequired = true;
bool _tokenEncryptionRequired = true;
Dictionary<string, object> _properties = new Dictionary<string, object>(); // for any custom data
/// <summary>
/// Initializes an instance of <see cref="Scope"/>
/// </summary>
public Scope()
: this(null, null, null)
{
}
/// <summary>
/// Initializes an instance of <see cref="Scope"/>
/// </summary>
/// <param name="appliesToAddress">The appliesTo address of the relying party.</param>
public Scope(string appliesToAddress)
: this(appliesToAddress, null, null)
{
}
/// <summary>
/// Initializes an instance of <see cref="Scope"/>
/// </summary>
/// <param name="appliesToAddress">The appliesTo address of the relying party.</param>
/// <param name="signingCredentials">The signing credentials for the relying party.</param>
public Scope(string appliesToAddress, SigningCredentials signingCredentials)
: this(appliesToAddress, signingCredentials, null)
{
}
/// <summary>
/// Initializes an instance of <see cref="Scope"/>
/// </summary>
/// <param name="appliesToAddress">The appliesTo address of the relying party.</param>
/// <param name="encryptingCredentials"> The encrypting credentials for the relying party.</param>
public Scope(string appliesToAddress, EncryptingCredentials encryptingCredentials)
: this(appliesToAddress, null, encryptingCredentials)
{
}
/// <summary>
/// Initializes an instance of <see cref="Scope"/>
/// </summary>
/// <param name="appliesToAddress">The appliesTo address of the relying party.</param>
/// <param name="signingCredentials">The signing credentials for the relying party.</param>
/// <param name="encryptingCredentials"> The encrypting credentials for the relying party.</param>
public Scope(string appliesToAddress, SigningCredentials signingCredentials, EncryptingCredentials encryptingCredentials)
{
_appliesToAddress = appliesToAddress;
_signingCredentials = signingCredentials;
_encryptingCredentials = encryptingCredentials;
}
/// <summary>
/// Gets or sets the appliesTo address of the relying party.
/// </summary>
public virtual string AppliesToAddress
{
get
{
return _appliesToAddress;
}
set
{
_appliesToAddress = value;
}
}
/// <summary>
/// Gets or sets the encrypting credentials.
/// </summary>
public virtual EncryptingCredentials EncryptingCredentials
{
get
{
return _encryptingCredentials;
}
set
{
_encryptingCredentials = value;
}
}
/// <summary>
/// Gets or sets the replyTo address of the relying party.
/// </summary>
public virtual string ReplyToAddress
{
get
{
return _replyToAddress;
}
set
{
_replyToAddress = value;
}
}
/// <summary>
/// Gets or sets the SigningCredentials for the relying party.
/// </summary>
public virtual SigningCredentials SigningCredentials
{
get
{
return _signingCredentials;
}
set
{
_signingCredentials = value;
}
}
/// <summary>
/// Gets or sets the property which determines if issued symmetric keys must
/// be encrypted by <see cref="Scope.EncryptingCredentials"/>.
/// </summary>
public virtual bool SymmetricKeyEncryptionRequired
{
get
{
return _symmetricKeyEncryptionRequired;
}
set
{
_symmetricKeyEncryptionRequired = value;
}
}
/// <summary>
/// Gets or sets the property which determines if issued security tokens must
/// be encrypted by <see cref="Scope.EncryptingCredentials"/>.
/// </summary>
public virtual bool TokenEncryptionRequired
{
get
{
return _tokenEncryptionRequired;
}
set
{
_tokenEncryptionRequired = value;
}
}
/// <summary>
/// Gets the properties bag to extend the object.
/// </summary>
public virtual Dictionary<string, object> Properties
{
get
{
return _properties;
}
}
}
}
|