本文整理汇总了C#中System.ServiceModel.Security.Tokens.SecurityTokenParameters类的典型用法代码示例。如果您正苦于以下问题:C# SecurityTokenParameters类的具体用法?C# SecurityTokenParameters怎么用?C# SecurityTokenParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SecurityTokenParameters类属于System.ServiceModel.Security.Tokens命名空间,在下文中一共展示了SecurityTokenParameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SecurityTokenParameters
protected SecurityTokenParameters(SecurityTokenParameters other)
{
if (other == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("other");
_requireDerivedKeys = other._requireDerivedKeys;
}
示例2: SecurityTokenParameters
protected SecurityTokenParameters (SecurityTokenParameters other)
{
inclusion_mode = other.inclusion_mode;
reference_style = other.reference_style;
require_derived_keys = other.require_derived_keys;
issuer_binding_context = other.issuer_binding_context != null ? other.issuer_binding_context.Clone () : null;
}
示例3: SupportingTokenSpecification
public SupportingTokenSpecification(SecurityToken token, ReadOnlyCollection<IAuthorizationPolicy> tokenPolicies, SecurityTokenAttachmentMode attachmentMode, SecurityTokenParameters tokenParameters)
: base(token, tokenPolicies)
{
SecurityTokenAttachmentModeHelper.Validate(attachmentMode);
_tokenAttachmentMode = attachmentMode;
_tokenParameters = tokenParameters;
}
示例4: InitializeNestedTokenParameterSettings
protected override void InitializeNestedTokenParameterSettings(SecurityTokenParameters sp, bool initializeNestedBindings)
{
if (sp is SecureConversationSecurityTokenParameters)
this.InitializeSecureConversationParameters((SecureConversationSecurityTokenParameters)sp, initializeNestedBindings);
else
base.InitializeNestedTokenParameterSettings(sp, initializeNestedBindings);
}
示例5: Add
public void Add(SecurityToken token, SecurityTokenReferenceStyle allowedReferenceStyle, SecurityTokenParameters tokenParameters)
{
if (token == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("token");
}
if ((allowedReferenceStyle == SecurityTokenReferenceStyle.External) && (tokenParameters == null))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(System.ServiceModel.SR.GetString("ResolvingExternalTokensRequireSecurityTokenParameters"));
}
this.EnsureCapacityToAddToken();
this.tokens[this.tokenCount++] = new SecurityTokenEntry(token, tokenParameters, allowedReferenceStyle);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:SecurityHeaderTokenResolver.cs
示例6: CreateWrappedKeyToken
private WrappedKeySecurityToken CreateWrappedKeyToken(SecurityToken wrappingToken, SecurityTokenParameters wrappingTokenParameters, SecurityTokenReferenceStyle wrappingTokenReferenceStyle)
{
int keyLength = Math.Max(0x80, this.Factory.OutgoingAlgorithmSuite.DefaultSymmetricKeyLength);
CryptoHelper.ValidateSymmetricKeyLength(keyLength, this.Factory.OutgoingAlgorithmSuite);
byte[] buffer = new byte[keyLength / 8];
CryptoHelper.FillRandomBytes(buffer);
string id = System.ServiceModel.Security.SecurityUtils.GenerateId();
string defaultAsymmetricKeyWrapAlgorithm = this.Factory.OutgoingAlgorithmSuite.DefaultAsymmetricKeyWrapAlgorithm;
SecurityKeyIdentifierClause clause = wrappingTokenParameters.CreateKeyIdentifierClause(wrappingToken, wrappingTokenReferenceStyle);
SecurityKeyIdentifier wrappingTokenReference = new SecurityKeyIdentifier();
wrappingTokenReference.Add(clause);
return new WrappedKeySecurityToken(id, buffer, defaultAsymmetricKeyWrapAlgorithm, wrappingToken, wrappingTokenReference);
}
示例7: AssertSecurityTokenParameters
public static void AssertSecurityTokenParameters (
SecurityTokenInclusionMode protectionTokenInclusionMode,
SecurityTokenReferenceStyle protectionTokenReferenceStyle,
bool protectionTokenRequireDerivedKeys,
SecurityTokenParameters tp, string label)
{
Assert.IsNotNull (tp, label + " IsNotNull");
Assert.AreEqual (protectionTokenInclusionMode,
tp.InclusionMode, label + ".InclusionMode");
Assert.AreEqual (protectionTokenReferenceStyle,
tp.ReferenceStyle, label + ".ReferenceStyle");
Assert.AreEqual (protectionTokenRequireDerivedKeys,
tp.RequireDerivedKeys, label + ".RequireDerivedKeys");
}
示例8: SupportingTokenProviderSpecification
public SupportingTokenProviderSpecification(SecurityTokenProvider tokenProvider, SecurityTokenAttachmentMode attachmentMode, SecurityTokenParameters tokenParameters)
{
if (tokenProvider == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("tokenProvider");
}
SecurityTokenAttachmentModeHelper.Validate(attachmentMode);
if (tokenParameters == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("tokenParameters");
}
_tokenProvider = tokenProvider;
_tokenAttachmentMode = attachmentMode;
_tokenParameters = tokenParameters;
}
示例9: GetTokensForOutgoingMessages
private void GetTokensForOutgoingMessages(out SecurityToken signingToken, out SecurityToken encryptionToken, out SecurityTokenParameters tokenParameters)
{
lock (this.ThisLock)
{
if (this.requireDerivedKeys)
{
signingToken = this.derivedSignatureToken;
encryptionToken = this.derivedEncryptionToken;
}
else
{
signingToken = encryptionToken = this.outgoingSessionToken;
}
}
tokenParameters = this.Factory.GetTokenParameters();
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:AcceptorSessionSymmetricMessageSecurityProtocol.cs
示例10: CheckForCookie
void CheckForCookie(SecurityTokenParameters tokenParameters, ServiceEndpoint endpoint)
{
bool cookie = false;
SecureConversationSecurityTokenParameters sc = tokenParameters as SecureConversationSecurityTokenParameters;
if (sc != null && sc.RequireCancellation == false)
cookie = true;
SspiSecurityTokenParameters sspi = tokenParameters as SspiSecurityTokenParameters;
if (sspi != null && sspi.RequireCancellation == false)
cookie = true;
SspiSecurityTokenParameters ssl = tokenParameters as SspiSecurityTokenParameters;
if (ssl != null && ssl.RequireCancellation == false)
cookie = true;
if (cookie)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.RequireNonCookieMode, endpoint.Binding.Name, endpoint.Binding.Namespace)));
}
示例11: SupportingTokenAuthenticatorSpecification
internal SupportingTokenAuthenticatorSpecification(SecurityTokenAuthenticator tokenAuthenticator, SecurityTokenResolver securityTokenResolver, System.ServiceModel.Security.SecurityTokenAttachmentMode attachmentMode, SecurityTokenParameters tokenParameters, bool isTokenOptional)
{
if (tokenAuthenticator == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("tokenAuthenticator");
}
SecurityTokenAttachmentModeHelper.Validate(attachmentMode);
if (tokenParameters == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("tokenParameters");
}
this.tokenAuthenticator = tokenAuthenticator;
this.tokenResolver = securityTokenResolver;
this.tokenAttachmentMode = attachmentMode;
this.tokenParameters = tokenParameters;
this.isTokenOptional = isTokenOptional;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:17,代码来源:SupportingTokenAuthenticatorSpecification.cs
示例12: AddEndorsingSupportingToken
public void AddEndorsingSupportingToken(SecurityToken token, SecurityTokenParameters parameters)
{
if (token == null)
{
throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("token");
}
if (parameters == null)
{
throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("parameters");
}
base.ThrowIfProcessingStarted();
this.elementContainer.AddEndorsingSupportingToken(token);
if (!(token is ProviderBackedSecurityToken))
{
this.shouldSignToHeader |= !base.RequireMessageProtection && (System.ServiceModel.Security.SecurityUtils.GetSecurityKey<AsymmetricSecurityKey>(token) != null);
}
this.AddParameters(ref this.endorsingTokenParameters, parameters);
}
示例13: AddBasicSupportingToken
public void AddBasicSupportingToken(SecurityToken token, SecurityTokenParameters parameters)
{
if (token == null)
{
throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("token");
}
if (parameters == null)
{
throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("parameters");
}
base.ThrowIfProcessingStarted();
SendSecurityHeaderElement tokenElement = new SendSecurityHeaderElement(token.Id, new TokenElement(token, base.StandardsManager)) {
MarkedForEncryption = true
};
this.elementContainer.AddBasicSupportingToken(tokenElement);
this.hasEncryptedTokens = true;
this.hasSignedTokens = true;
this.AddParameters(ref this.basicSupportingTokenParameters, parameters);
}
示例14: TryImportWsspX509TokenAssertion
public virtual bool TryImportWsspX509TokenAssertion(MetadataImporter importer, XmlElement assertion, out SecurityTokenParameters parameters)
{
parameters = null;
SecurityTokenInclusionMode inclusionMode;
Collection<Collection<XmlElement>> alternatives;
if (IsWsspAssertion(assertion, X509TokenName)
&& TryGetIncludeTokenValue(assertion, out inclusionMode))
{
if (TryGetNestedPolicyAlternatives(importer, assertion, out alternatives))
{
foreach (Collection<XmlElement> alternative in alternatives)
{
X509SecurityTokenParameters x509 = new X509SecurityTokenParameters();
parameters = x509;
if (TryImportWsspRequireDerivedKeysAssertion(alternative, x509)
&& TryImportX509ReferenceStyleAssertion(alternative, x509)
&& TryImportWsspAssertion(alternative, WssX509V3Token10Name, true)
&& alternative.Count == 0)
{
parameters.InclusionMode = inclusionMode;
break;
}
else
{
parameters = null;
}
}
}
else
{
parameters = new X509SecurityTokenParameters();
parameters.RequireDerivedKeys = false;
parameters.InclusionMode = inclusionMode;
}
}
return parameters != null;
}
示例15: TryImportWsspKerberosTokenAssertion
public virtual bool TryImportWsspKerberosTokenAssertion(MetadataImporter importer, XmlElement assertion, out SecurityTokenParameters parameters)
{
parameters = null;
SecurityTokenInclusionMode inclusionMode;
Collection<Collection<XmlElement>> alternatives;
if (IsWsspAssertion(assertion, KerberosTokenName)
&& TryGetIncludeTokenValue(assertion, out inclusionMode))
{
if (TryGetNestedPolicyAlternatives(importer, assertion, out alternatives))
{
foreach (Collection<XmlElement> alternative in alternatives)
{
parameters = new KerberosSecurityTokenParameters();
if (TryImportWsspRequireDerivedKeysAssertion(alternative, parameters)
&& TryImportWsspAssertion(alternative, WssGssKerberosV5ApReqToken11Name, true)
&& alternative.Count == 0)
{
parameters.InclusionMode = inclusionMode;
break;
}
else
{
parameters = null;
}
}
}
else
{
parameters = new KerberosSecurityTokenParameters();
parameters.RequireDerivedKeys = false;
parameters.InclusionMode = inclusionMode;
}
}
return parameters != null;
}