Azavea.Open.DAO.ConnectionDescriptor.GetDecryptedConfigParameter C# (CSharp) Method

GetDecryptedConfigParameter() protected static method

This method is provided for convenience. If decryptionDelegate is not null, will use it to decrypt whatever value is in the config parameter.
protected static GetDecryptedConfigParameter ( Config config, string component, string paramName, ConnectionInfoDecryptionDelegate decryptionDelegate ) : string
config Azavea.Open.Common.Config Config file to get the parameter from.
component string Section within the config file.
paramName string Name of the paraneter within the section.
decryptionDelegate ConnectionInfoDecryptionDelegate Method to call to decrypt the parameter. May be null if using plain text.
return string
        protected static string GetDecryptedConfigParameter(Config config,
            string component, string paramName, ConnectionInfoDecryptionDelegate decryptionDelegate)
        {
            string retVal = config.GetParameter(component, paramName, null);
            if ((decryptionDelegate != null) && (!String.IsNullOrEmpty(retVal)))
            {
                retVal = decryptionDelegate.Invoke(retVal);
            }
            return retVal;
        }