Brunet.Security.SecurityPolicy.Supports C# (CSharp) Method

Supports() public static method

Returns true if the SPI is supported, false otherwise.
public static Supports ( int Index ) : bool
Index int
return bool
    public static bool Supports(int Index) {
      return _splist.ContainsKey(Index);
    }

Usage Example

Example #1
0
        /// <summary>This is SecureData that needs to get to an SA.</summary>
        protected void HandleData(MemBlock b, ISender return_path)
        {
            SecurityDataMessage sdm = new SecurityDataMessage(b);
            Dictionary <ISender, SecurityAssociation> sender_to_sa = null;
            SecurityAssociation sa = null;

            try {
                sender_to_sa = _spi[sdm.SPI];
                sa           = sender_to_sa[return_path];
                sa.HandleData(b, return_path, null);
            } catch {
                if (sender_to_sa == null && !SecurityPolicy.Supports(sdm.SPI))
                {
                    throw new Exception("Invalid SPI: " + sdm.SPI);
                }
                else if (sa == null)
                {
                    NoSuchSA(sdm.SPI, return_path);
                    throw new Exception("No SA for: " + return_path);
                }
                else if (sa.Closed)
                {
                    throw new Exception("SA has been closed.");
                }
                else
                {
                    throw;
                }
            }
        }
All Usage Examples Of Brunet.Security.SecurityPolicy::Supports