当前位置: 首页>>代码示例>>C#>>正文


C# Tokens.SecurityTokenParameters类代码示例

本文整理汇总了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;
        }
开发者ID:weshaggard,项目名称:wcf,代码行数:7,代码来源:SecurityTokenParameters.cs

示例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;
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:SecurityTokenParameters.cs

示例3: SupportingTokenSpecification

 public SupportingTokenSpecification(SecurityToken token, ReadOnlyCollection<IAuthorizationPolicy> tokenPolicies, SecurityTokenAttachmentMode attachmentMode, SecurityTokenParameters tokenParameters)
     : base(token, tokenPolicies)
 {
     SecurityTokenAttachmentModeHelper.Validate(attachmentMode);
     _tokenAttachmentMode = attachmentMode;
     _tokenParameters = tokenParameters;
 }
开发者ID:SoumikMukherjeeDOTNET,项目名称:wcf,代码行数:7,代码来源:SupportingTokenSpecification.cs

示例4: InitializeNestedTokenParameterSettings

 protected override void InitializeNestedTokenParameterSettings(SecurityTokenParameters sp, bool initializeNestedBindings)
 {
     if (sp is SecureConversationSecurityTokenParameters)
         this.InitializeSecureConversationParameters((SecureConversationSecurityTokenParameters)sp, initializeNestedBindings);
     else
         base.InitializeNestedTokenParameterSettings(sp, initializeNestedBindings);
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:SecurityElement.cs

示例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);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:SymmetricSecurityProtocol.cs

示例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");
		}
开发者ID:nickchal,项目名称:pash,代码行数:14,代码来源:SecurityAssert.cs

示例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;
 }
开发者ID:weshaggard,项目名称:wcf,代码行数:15,代码来源:SupportingTokenProviderSpecification.cs

示例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)));

        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:16,代码来源:SecurityCookieModeValidator.cs

示例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);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:18,代码来源:SendSecurityHeader.cs

示例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);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:19,代码来源:SendSecurityHeader.cs

示例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;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:40,代码来源:WSSecurityPolicy.cs

示例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;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:38,代码来源:WSSecurityPolicy.cs


注:本文中的System.ServiceModel.Security.Tokens.SecurityTokenParameters类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。