Show / Hide Table of Contents

Class BrowsingCacheExtension

Cache Extension.

Inheritance
System.Object
BrowsingCacheExtension
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)
System.Object.ToString()
Namespace: Gee.External.Browsing.Cache
Assembly: Gee.External.Browsing.dll
Syntax
public static class BrowsingCacheExtension

Methods

GetSafeCacheEntryAsync(IBrowsingCache, String)

Get a Safe Cache Entry Asynchronously.

Declaration
public static Task<SafeCacheEntry> GetSafeCacheEntryAsync(this IBrowsingCache this, string threatSha256HashPrefix)
Parameters
Type Name Description
IBrowsingCache this

A IBrowsingCache.

System.String threatSha256HashPrefix

A SHA256 hash prefix, formatted as a hexadecimal encoded string, identifying a threat to retrieve from the cache.

Returns
Type Description
System.Threading.Tasks.Task<SafeCacheEntry>

The SafeCacheEntry cached for the threat identified by threatSha256HashPrefix. A null reference indicates a safe cache entry is not cached.

Exceptions
Type Condition
BrowsingCacheException

Thrown if a caching error occurs.

System.ArgumentNullException

Thrown if threatSha256HashPrefix is a null reference.

System.ObjectDisposedException

Thrown if this is disposed.

GetUnsafeCacheEntryAsync(IBrowsingCache, String)

Get an Unsafe Cache Entry Asynchronously.

Declaration
public static Task<UnsafeCacheEntry> GetUnsafeCacheEntryAsync(this IBrowsingCache this, string threatSha256Hash)
Parameters
Type Name Description
IBrowsingCache this

A IBrowsingCache.

System.String threatSha256Hash

A full SHA256 hash, formatted as a hexadecimal encoded string, identifying a threat to retrieve from the cache.

Returns
Type Description
System.Threading.Tasks.Task<UnsafeCacheEntry>

The UnsafeCacheEntry cached for the threat identified by threatSha256Hash. A null reference indicates an unsafe cache entry is not cached.

Exceptions
Type Condition
BrowsingCacheException

Thrown if a caching error occurs.

System.ArgumentNullException

Thrown if threatSha256Hash is a null reference.

System.ObjectDisposedException

Thrown if this is disposed.

LookupAsync(IBrowsingCache, String, String)

Lookup a Threat Asynchronously.

Declaration
public static Task<CacheLookupResult> LookupAsync(this IBrowsingCache this, string threatSha256Hash, string threatSha256HashPrefix)
Parameters
Type Name Description
IBrowsingCache this

A IBrowsingCache.

System.String threatSha256Hash

A full SHA256 hash, formatted as a hexadecimal encoded string, identifying a threat to lookup in the cache.

System.String threatSha256HashPrefix

A SHA256 hash prefix, formatted as a hexadecimal encoded string, identifying a threat to lookup in the cache.

Returns
Type Description
System.Threading.Tasks.Task<CacheLookupResult>

A CacheLookupResult indicating the nature of the operation.

Exceptions
Type Condition
BrowsingCacheException

Thrown if a caching error occurs.

System.ArgumentNullException

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

System.ArgumentNullException

Thrown if this is a null reference.

System.ObjectDisposedException

Thrown if this is disposed.

LookupAsync(IBrowsingCache, String, String, CancellationToken)

Lookup a Threat Asynchronously.

Declaration
public static Task<CacheLookupResult> LookupAsync(this IBrowsingCache this, string threatSha256Hash, string threatSha256HashPrefix, CancellationToken cancellationToken)
Parameters
Type Name Description
IBrowsingCache this

A IBrowsingCache.

System.String threatSha256Hash

A full SHA256 hash, formatted as a hexadecimal encoded string, identifying a threat to lookup in the cache.

System.String threatSha256HashPrefix

A SHA256 hash prefix, formatted as a hexadecimal encoded string, identifying a threat to lookup in the cache.

System.Threading.CancellationToken cancellationToken

A cancellation token to cancel the asynchronous operation with.

Returns
Type Description
System.Threading.Tasks.Task<CacheLookupResult>

A CacheLookupResult indicating the nature of the operation.

Exceptions
Type Condition
BrowsingCacheException

Thrown if a caching error occurs.

System.ArgumentNullException

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

System.ObjectDisposedException

Thrown if this is disposed.

System.OperationCanceledException

Thrown if the asynchronous operation is cancelled.

PutSafeCacheEntryAsync(IBrowsingCache, SafeCacheEntry)

Put a Safe Cache Entry Asynchronously.

Declaration
public static Task PutSafeCacheEntryAsync(this IBrowsingCache this, SafeCacheEntry safeCacheEntry)
Parameters
Type Name Description
IBrowsingCache this

A IBrowsingCache.

SafeCacheEntry safeCacheEntry

A SafeCacheEntry to cache.

Returns
Type Description
System.Threading.Tasks.Task

A task representing the asynchronous operation.

Exceptions
Type Condition
BrowsingCacheException

Thrown if a caching error occurs.

System.ArgumentNullException

Thrown if safeCacheEntry is a null reference.

System.ObjectDisposedException

Thrown if this is disposed.

PutSafeCacheEntryAsync(IBrowsingCache, String, DateTime)

Put a Safe Cache Entry Asynchronously.

Declaration
public static Task PutSafeCacheEntryAsync(this IBrowsingCache this, string threatSha256HashPrefix, DateTime expirationDate)
Parameters
Type Name Description
IBrowsingCache this

A IBrowsingCache.

System.String threatSha256HashPrefix

A SHA256 hash prefix, formatted as a hexadecimal encoded string, identifying a threat to cache.

System.DateTime expirationDate

The date, in Coordinated Universal Time (UTC), the safe cache entry expires and the threat identified by threatSha256HashPrefix should be considered safe to. If the date is not in UTC, it is converted to it.

Returns
Type Description
System.Threading.Tasks.Task

A task representing the asynchronous operation.

Exceptions
Type Condition
BrowsingCacheException

Thrown if a caching error occurs.

System.ArgumentNullException

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

System.ObjectDisposedException

Thrown if this is disposed.

PutSafeCacheEntryAsync(IBrowsingCache, String, DateTime, CancellationToken)

Put a Safe Cache Entry Asynchronously.

Declaration
public static Task PutSafeCacheEntryAsync(this IBrowsingCache this, string threatSha256HashPrefix, DateTime expirationDate, CancellationToken cancellationToken)
Parameters
Type Name Description
IBrowsingCache this

A IBrowsingCache.

System.String threatSha256HashPrefix

A SHA256 hash prefix, formatted as a hexadecimal encoded string, identifying a threat to cache.

System.DateTime expirationDate

The date, in Coordinated Universal Time (UTC), the safe cache entry expires and the threat identified by threatSha256HashPrefix should be considered safe to. If the date is not in UTC, it is converted to it.

System.Threading.CancellationToken cancellationToken

A cancellation token to cancel the asynchronous operation with.

Returns
Type Description
System.Threading.Tasks.Task

A task representing the asynchronous operation.

Exceptions
Type Condition
BrowsingCacheException

Thrown if a caching error occurs.

System.ArgumentNullException

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

System.ObjectDisposedException

Thrown if the object is disposed.

System.OperationCanceledException

Thrown if the asynchronous operation is cancelled.

PutUnsafeCacheEntryAsync(IBrowsingCache, UnsafeCacheEntry)

Put an Unsafe Cache Entry Asynchronously.

Declaration
public static Task PutUnsafeCacheEntryAsync(this IBrowsingCache this, UnsafeCacheEntry unsafeCacheEntry)
Parameters
Type Name Description
IBrowsingCache this

A IBrowsingCache.

UnsafeCacheEntry unsafeCacheEntry

An UnsafeCacheEntry to cache.

Returns
Type Description
System.Threading.Tasks.Task

A task representing the asynchronous operation.

Exceptions
Type Condition
BrowsingCacheException

Thrown if a caching error occurs.

System.ArgumentNullException

Thrown if unsafeCacheEntry is a null reference.

System.ObjectDisposedException

Thrown if this is disposed.

PutUnsafeCacheEntryAsync(IBrowsingCache, String, IEnumerable<UnsafeThreat>)

Put an Unsafe Cache Entry Asynchronously.

Declaration
public static Task PutUnsafeCacheEntryAsync(this IBrowsingCache this, string threatSha256Hash, IEnumerable<UnsafeThreat> unsafeThreats)
Parameters
Type Name Description
IBrowsingCache this

A IBrowsingCache.

System.String threatSha256Hash

A full SHA256 hash, formatted as a hexadecimal encoded string, identifying a threat to cache.

System.Collections.Generic.IEnumerable<UnsafeThreat> unsafeThreats

A collection of UnsafeThreat to cache.

Returns
Type Description
System.Threading.Tasks.Task

A task representing the asynchronous operation.

Exceptions
Type Condition
BrowsingCacheException

Thrown if a caching error occurs.

System.ArgumentNullException

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

System.ObjectDisposedException

Thrown if this is disposed.

PutUnsafeCacheEntryAsync(IBrowsingCache, String, IEnumerable<UnsafeThreat>, CancellationToken)

Put an Unsafe Cache Entry Asynchronously.

Declaration
public static Task PutUnsafeCacheEntryAsync(this IBrowsingCache this, string threatSha256Hash, IEnumerable<UnsafeThreat> unsafeThreats, CancellationToken cancellationToken)
Parameters
Type Name Description
IBrowsingCache this

A IBrowsingCache.

System.String threatSha256Hash

A full SHA256 hash, formatted as a hexadecimal encoded string, identifying a threat to cache.

System.Collections.Generic.IEnumerable<UnsafeThreat> unsafeThreats

A collection of UnsafeThreat to cache.

System.Threading.CancellationToken cancellationToken

A cancellation token to cancel the asynchronous operation with.

Returns
Type Description
System.Threading.Tasks.Task

A task representing the asynchronous operation.

Exceptions
Type Condition
BrowsingCacheException

Thrown if a caching error occurs.

System.ArgumentNullException

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

System.ObjectDisposedException

Thrown if this is disposed.

System.OperationCanceledException

Thrown if the asynchronous operation is cancelled.

RemoveSafeCacheEntryAsync(IBrowsingCache, String)

Remove a Safe Cache Entry Asynchronously.

Declaration
public static Task RemoveSafeCacheEntryAsync(this IBrowsingCache this, string threatSha256HashPrefix)
Parameters
Type Name Description
IBrowsingCache this

A IBrowsingCache.

System.String threatSha256HashPrefix

A SHA256 hash prefix, formatted as a hexadecimal encoded string, identifying a threat to remove from the cache.

Returns
Type Description
System.Threading.Tasks.Task

A task representing the asynchronous operation.

Exceptions
Type Condition
BrowsingCacheException

Thrown if a caching error occurs.

System.ArgumentNullException

Thrown if this is a null reference.

System.ObjectDisposedException

Thrown if this is disposed.

RemoveUnsafeCacheEntryAsync(IBrowsingCache, String)

Remove an Unsafe Cache Entry Asynchronously.

Declaration
public static Task RemoveUnsafeCacheEntryAsync(this IBrowsingCache this, string threatSha256Hash)
Parameters
Type Name Description
IBrowsingCache this

A IBrowsingCache.

System.String threatSha256Hash

A full SHA256 hash, formatted as a hexadecimal encoded string, identifying a threat to remove from the cache.

Returns
Type Description
System.Threading.Tasks.Task

A task representing the asynchronous operation.

Exceptions
Type Condition
BrowsingCacheException

Thrown if a caching error occurs.

System.ArgumentNullException

Thrown if this is a null reference.

System.ObjectDisposedException

Thrown if this is disposed.

Back to top Generated by DocFX