public void AddEndorsingSupportingToken(SecurityToken token, SecurityTokenParameters parameters) { if (token == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(token)); } if (parameters == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(parameters)); } ThrowIfProcessingStarted(); ElementContainer.AddEndorsingSupportingToken(token); // The ProviderBackedSecurityToken was added for the ChannelBindingToken (CBT) effort for win7. // We can assume the key is of type symmetric key. // // Asking for the key type from the token will cause the ProviderBackedSecurityToken // to attempt to resolve the token and the nego will start. // // We don't want that. // We want to defer the nego until after the CBT is available in SecurityAppliedMessage.OnWriteMessage. //TODO //if (!(token is ProviderBackedSecurityToken)) //{ // this.shouldSignToHeader |= (!this.RequireMessageProtection) && (SecurityUtils.GetSecurityKey<AsymmetricSecurityKey>(token) != null); //} AddParameters(ref _endorsingTokenParameters, parameters); }
public void AddEndorsingSupportingToken(SecurityToken token, SecurityTokenParameters parameters) { if (token == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(token)); } if (parameters == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(parameters)); } ThrowIfProcessingStarted(); ElementContainer.AddEndorsingSupportingToken(token); ShouldSignToHeader |= (!RequireMessageProtection) && (SecurityUtils.GetSecurityKey <AsymmetricSecurityKey>(token) != null); AddParameters(ref _endorsingTokenParameters, parameters); }