コード例 #1
0
        // If any changes are made to this method, please make sure that they are
        // reflected in the corresponding IsSecureConversationBinding() method.
        public static SecurityBindingElement CreateSecureConversationBindingElement(SecurityBindingElement bootstrapSecurity, bool requireCancellation, ChannelProtectionRequirements bootstrapProtectionRequirements)
        {
            if (bootstrapSecurity == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("bootstrapBinding");
            }

            SecurityBindingElement result;

            if (bootstrapSecurity is TransportSecurityBindingElement)
            {
                // there is no need to do replay detection or key derivation for transport bindings
                TransportSecurityBindingElement           primary      = new TransportSecurityBindingElement();
                SecureConversationSecurityTokenParameters scParameters = new SecureConversationSecurityTokenParameters(
                    bootstrapSecurity,
                    requireCancellation,
                    bootstrapProtectionRequirements)
                {
                    RequireDerivedKeys = false
                };
                primary.EndpointSupportingTokenParameters.Endorsing.Add(
                    scParameters);
                // primary.LocalClientSettings.DetectReplays = false;
                primary.LocalServiceSettings.DetectReplays = false;
                primary.IncludeTimestamp = true;
                result = primary;
            }
            else // Symmetric- or AsymmetricSecurityBindingElement
            {
                SymmetricSecurityBindingElement primary = new SymmetricSecurityBindingElement(
                    new SecureConversationSecurityTokenParameters(
                        bootstrapSecurity,
                        requireCancellation,
                        bootstrapProtectionRequirements))
                {
                    // there is no need for signature confirmation on the steady state binding
                    RequireSignatureConfirmation = false
                };
                result = primary;
            }
            return(result);
        }
コード例 #2
0
 public static SecurityBindingElement CreateSecureConversationBindingElement(SecurityBindingElement bootstrapSecurity, bool requireCancellation)
 {
     return(CreateSecureConversationBindingElement(bootstrapSecurity, requireCancellation, null));
 }
コード例 #3
0
 // If any changes are made to this method, please make sure that they are
 // reflected in the corresponding IsSecureConversationBinding() method.
 public static SecurityBindingElement CreateSecureConversationBindingElement(SecurityBindingElement bootstrapSecurity)
 {
     return(CreateSecureConversationBindingElement(bootstrapSecurity, SecureConversationSecurityTokenParameters.defaultRequireCancellation, null));
 }