internal string GetSignatureKeyDerivationAlgorithm(SecurityToken token, SecureConversationVersion version)
        {
            if (token == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("token");
            }

            string derivationAlgorithm = SecurityUtils.GetKeyDerivationAlgorithm(version);

            if (SecurityUtils.IsSupportedAlgorithm(derivationAlgorithm, token))
            {
                return(derivationAlgorithm);
            }
            else
            {
                return(null);
            }
        }
        internal void GetKeyWrapAlgorithm(SecurityToken token, out string keyWrapAlgorithm, out XmlDictionaryString keyWrapAlgorithmDictionaryString)
        {
            if (token == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("token");
            }

            if (SecurityUtils.IsSupportedAlgorithm(this.DefaultSymmetricKeyWrapAlgorithm, token))
            {
                keyWrapAlgorithm = this.DefaultSymmetricKeyWrapAlgorithm;
                keyWrapAlgorithmDictionaryString = this.DefaultSymmetricKeyWrapAlgorithmDictionaryString;
            }
            else
            {
                keyWrapAlgorithm = this.DefaultAsymmetricKeyWrapAlgorithm;
                keyWrapAlgorithmDictionaryString = this.DefaultAsymmetricKeyWrapAlgorithmDictionaryString;
            }
        }
        internal int GetSignatureKeyDerivationLength(SecurityToken token, SecureConversationVersion version)
        {
            if (token == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("token");
            }

            string derivationAlgorithm = SecurityUtils.GetKeyDerivationAlgorithm(version);

            if (SecurityUtils.IsSupportedAlgorithm(derivationAlgorithm, token))
            {
                if (this.DefaultSignatureKeyDerivationLength % 8 != 0)
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(string.Format(SRServiceModel.Psha1KeyLengthInvalid, this.DefaultSignatureKeyDerivationLength)));
                }

                return(this.DefaultSignatureKeyDerivationLength / 8);
            }
            else
            {
                return(0);
            }
        }