Example #1
0
        private bool IsSupportedKeyWrapAlgorithm(string algorithm, object[] args, out KeyWrapProviderDescriptor descriptor)
        {
            if (args.Length > 0)
            {
                if (args[0] is SecurityKey key)
                {
                    if (args.Length == 2 && args[1] is bool willUnwrap)
                    {
                        return(IsSupportedKeyWrapAlgorithm(algorithm, key, willUnwrap, out descriptor));
                    }
                    return(IsSupportedKeyWrapAlgorithm(algorithm, key, null, out descriptor));
                }
            }

            descriptor = null;
            return(false);
        }
Example #2
0
 private bool IsSupportedKeyWrapAlgorithm(string algorithm, SecurityKey key, bool?willUnwrap, out KeyWrapProviderDescriptor descriptor)
 => _options.SupportedKeyWrapAlgorithms.TryGetValue(algorithm, out descriptor);