Show / Hide Table of Contents

Class CacheLookupResult

Cache Lookup Result.

Inheritance
System.Object
CacheLookupResult
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Gee.External.Browsing.Cache
Assembly: Gee.External.Browsing.dll
Syntax
public sealed class CacheLookupResult

Properties

IsCacheMiss

Determine if Cache Lookup Result Indicates a Cache Miss.

Declaration
public bool IsCacheMiss { get; }
Property Value
Type
System.Boolean
Remarks

Determines if the cache lookup result indicates a Miss.

IsCacheSafeHit

Determine if Cache Lookup Result Indicates a Cache Safe Hit.

Declaration
public bool IsCacheSafeHit { get; }
Property Value
Type
System.Boolean
Remarks

Determines if the cache lookup result indicates a SafeHit.

IsCacheUnsafeHit

Determine if Cache Lookup Result Indicates a Cache Unsafe Hit.

Declaration
public bool IsCacheUnsafeHit { get; }
Property Value
Type
System.Boolean
Remarks

Determines if the cache lookup result indicates an UnsafeHit.

ResultCode

Get Result Code.

Declaration
public CacheLookupResultCode ResultCode { get; }
Property Value
Type
CacheLookupResultCode
Remarks

Represents the CacheLookupResultCode indicating the nature of the cache lookup result.

ThreatSha256Hash

Get Threat's SHA256 Hash.

Declaration
public string ThreatSha256Hash { get; }
Property Value
Type
System.String
Remarks

Represents the full SHA256 hash, formatted as a hexadecimal encoded string, identifying the threat that was looked up in a IBrowsingCache.

ThreatSha256HashPrefix

Get Threat's SHA256 Hash Prefix.

Declaration
public string ThreatSha256HashPrefix { get; }
Property Value
Type
System.String
Remarks

Represents the SHA256 hash prefix, formatted as a hexadecimal encoded string, identifying the threat that was looked up in a IBrowsingCache.

UnsafeThreatListDescriptors

Get Unsafe Threat List Descriptors.

Declaration
public IEnumerable<ThreatListDescriptor> UnsafeThreatListDescriptors { get; }
Property Value
Type
System.Collections.Generic.IEnumerable<ThreatListDescriptor>
Remarks

Represents the unique collection of ThreatListDescriptor identifying the unique collection of ThreatList the collection of UnsafeThreats is associated with if, and only if, the cache lookup result indicates an UnsafeHit. To determine if the cache lookup result indicates a cache unsafe hit, call IsCacheUnsafeHit.

Exceptions
Type Condition
System.InvalidOperationException

Thrown if the cache lookup result does not indicate a UnsafeHit.

UnsafeThreats

Get Unsafe Threats

Declaration
public IEnumerable<UnsafeThreat> UnsafeThreats { get; }
Property Value
Type
System.Collections.Generic.IEnumerable<UnsafeThreat>
Remarks

Represents the collection of UnsafeThreat that was retrieved from a IBrowsingCache if, and only if, the cache lookup result indicates an UnsafeHit. To determine if the cache lookup result indicates a cache unsafe hit, call IsCacheUnsafeHit.

Exceptions
Type Condition
System.InvalidOperationException

Thrown if the cache lookup result does not indicate a UnsafeHit.

Methods

CacheMiss(String, String)

Create a Cache Result Indicating a Cache Miss.

Declaration
public static CacheLookupResult CacheMiss(string threatSha256Hash, string threatSha256HashPrefix)
Parameters
Type Name Description
System.String threatSha256Hash

A full SHA256 hash, formatted as a hexadecimal encoded string, identifying the threat that was looked up in a IBrowsingCache.

System.String threatSha256HashPrefix

A SHA256 hash prefix, formatted as a hexadecimal encoded string, identifying the threat that was looked up in a IBrowsingCache.

Returns
Type Description
CacheLookupResult

A cache lookup result indicating a Miss.

Exceptions
Type Condition
System.ArgumentNullException

Thrown if threatSha256Hash is a null reference, or if threatSha256HashPrefix is a null reference.

System.FormatException

Thrown if threatSha256Hash is not formatted as a hexadecimal encoded string, or if threatSha256HashPrefix is not formatted as a hexadecimal encoded string.

CacheSafeHit(String, String)

Create a Cache Result Indicating a Cache Safe Hit.

Declaration
public static CacheLookupResult CacheSafeHit(string threatSha256Hash, string threatSha256HashPrefix)
Parameters
Type Name Description
System.String threatSha256Hash

A full SHA256 hash, formatted as a hexadecimal encoded string, identifying the threat that was looked up in a IBrowsingCache.

System.String threatSha256HashPrefix

A SHA256 hash prefix, formatted as a hexadecimal encoded string, identifying the threat that was looked up in a IBrowsingCache.

Returns
Type Description
CacheLookupResult

A cache lookup result indicating a SafeHit.

Exceptions
Type Condition
System.ArgumentNullException

Thrown if threatSha256Hash is a null reference, or if threatSha256HashPrefix is a null reference.

System.FormatException

Thrown if threatSha256Hash is not formatted as a hexadecimal encoded string, or if threatSha256HashPrefix is not formatted as a hexadecimal encoded string.

CacheUnsafeHit(String, String, IEnumerable<UnsafeThreat>)

Create a Cache Result Indicating a Cache Unsafe Hit.

Declaration
public static CacheLookupResult CacheUnsafeHit(string threatSha256Hash, string threatSha256HashPrefix, IEnumerable<UnsafeThreat> unsafeThreats)
Parameters
Type Name Description
System.String threatSha256Hash

A full SHA256 hash, formatted as a hexadecimal encoded string, identifying the threat that was looked up in a IBrowsingCache.

System.String threatSha256HashPrefix

A SHA256 hash prefix, formatted as a hexadecimal encoded string, identifying the threat that was looked up in a IBrowsingCache.

System.Collections.Generic.IEnumerable<UnsafeThreat> unsafeThreats

A collection of UnsafeThreat that was retrieved from a IBrowsingCache.

Returns
Type Description
CacheLookupResult

A cache lookup result indicating a UnsafeHit.

Exceptions
Type Condition
System.ArgumentNullException

Thrown if threatSha256Hash is a null reference, or if threatSha256HashPrefix is a null reference, or if unsafeThreats is a null reference.

System.FormatException

Thrown if threatSha256Hash is not formatted as a hexadecimal encoded string, or if threatSha256HashPrefix is not formatted as a hexadecimal encoded string.

ToString()

Get Object's String Representation.

Declaration
public override string ToString()
Returns
Type Description
System.String

The object's string representation.

Overrides
System.Object.ToString()
Back to top Generated by DocFX