internal string GetSignatureKeyDerivationAlgorithm(SecurityToken token, SecureConversationVersion version) { if (token == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(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(nameof(token)); } if (SecurityUtils.IsSupportedAlgorithm(DefaultSymmetricKeyWrapAlgorithm, token)) { keyWrapAlgorithm = DefaultSymmetricKeyWrapAlgorithm; keyWrapAlgorithmDictionaryString = DefaultSymmetricKeyWrapAlgorithmDictionaryString; } else { keyWrapAlgorithm = DefaultAsymmetricKeyWrapAlgorithm; keyWrapAlgorithmDictionaryString = DefaultAsymmetricKeyWrapAlgorithmDictionaryString; } }
internal int GetSignatureKeyDerivationLength(SecurityToken token, SecureConversationVersion version) { if (token == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(token)); } string derivationAlgorithm = SecurityUtils.GetKeyDerivationAlgorithm(version); if (SecurityUtils.IsSupportedAlgorithm(derivationAlgorithm, token)) { if (DefaultSignatureKeyDerivationLength % 8 != 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(SR.Format(SR.Psha1KeyLengthInvalid, DefaultSignatureKeyDerivationLength))); } return(DefaultSignatureKeyDerivationLength / 8); } else { return(0); } }