AaltoTLS.PluginInterface.CipherSuitePluginManager.GetSupportedSignatureAndHashAlgorithms C# (CSharp) Method

GetSupportedSignatureAndHashAlgorithms() public method

public GetSupportedSignatureAndHashAlgorithms ( ) : System.UInt16[]
return System.UInt16[]
        public UInt16[] GetSupportedSignatureAndHashAlgorithms()
        {
            List<UInt16> sighashes = new List<UInt16>();
            foreach (CipherSuitePlugin plugin in _plugins) {
                string[] sigIDs = plugin.SupportedSignatureAlgorithms;
                foreach (string sigID in sigIDs) {
                    SignatureAlgorithm sig = plugin.GetSignatureAlgorithm(sigID);
                    if (sig == null)
                        continue;

                    byte sigType = sig.SignatureAlgorithmType;
                    if (sigType == 0) {
                        // Ignore anonymous
                        continue;
                    }

                    // TODO: Now scans from sha512 to md5, should be configurable?
                    for (byte b=6; b>0; b--) {
                        if (!sig.SupportsHashAlgorithmType(b))
                            continue;
                        sighashes.Add((UInt16)((b << 8) | sigType));
                    }
                }
            }
            return sighashes.ToArray();
        }