Zero Install .NET API 2.20.0
ZeroInstall.Store.Trust.TrustDB Class Reference

A database of OpenPGP signature fingerprints the users trusts to sign Feeds coming from specific domains. More...

Inheritance diagram for ZeroInstall.Store.Trust.TrustDB:
NanoByte.Common.ICloneable< TrustDB >

Public Member Functions

bool IsTrusted (string fingerprint, Domain domain)
 Determines whether a key is trusted for a specific domain. More...
 
void TrustKey (string fingerprint, Domain domain)
 Marks a key as trusted for a specific domain. More...
 
void UntrustKey (string fingerprint, Domain domain)
 Marks a key as no longer trusted for a specific domain. More...
 
bool Save ()
 Saves the this TrustDB to the location it was loaded from if possible. More...
 
void Save (string path)
 Saves this TrustDB to a file. More...
 
TrustDB Clone ()
 Creates a deep copy of this TrustDB instance. More...
 
bool Equals (TrustDB? other)
 
override bool Equals (object? obj)
 
override int GetHashCode ()
 
- Public Member Functions inherited from NanoByte.Common.ICloneable< TrustDB >
TrustDB Clone ()
 

Static Public Member Functions

static TrustDB Load (string path)
 Loads the TrustDB from a file. More...
 
static TrustDB LoadSafe ()
 Tries to load the TrustDB from the DefaultLocation. Automatically falls back to defaults on errors. More...
 

Public Attributes

string XsiSchemaLocation = XmlNamespace + " " + XsdLocation
 Provides XML Editors with location hints for XSD files.
 

Static Public Attributes

const string XmlNamespace = "http://zero-install.sourceforge.net/2007/injector/trust"
 The XML namespace used for storing trust-related data.
 
const string XsdLocation = "https://docs.0install.net/specifications/trust.xsd"
 The URI to retrieve an XSD containing the XML Schema information for this class in serialized form.
 

Properties

List< KeyKeys = new() [get]
 A list of known Keys.
 
static string DefaultLocation [get]
 The default file path used to store the TrustDB.
 

Detailed Description

A database of OpenPGP signature fingerprints the users trusts to sign Feeds coming from specific domains.

Member Function Documentation

◆ Clone()

TrustDB ZeroInstall.Store.Trust.TrustDB.Clone ( )
inline

Creates a deep copy of this TrustDB instance.

Returns
The new copy of the TrustDB.

◆ IsTrusted()

bool ZeroInstall.Store.Trust.TrustDB.IsTrusted ( string  fingerprint,
Domain  domain 
)
inline

Determines whether a key is trusted for a specific domain.

Parameters
fingerprintThe fingerprint of the key to check.
domainThe domain the key should be valid for.

◆ Load()

static TrustDB ZeroInstall.Store.Trust.TrustDB.Load ( string  path)
inlinestatic

Loads the TrustDB from a file.

Parameters
pathThe file to load from.
Returns
The loaded TrustDB.
Exceptions
IOExceptionA problem occured while reading the file.
UnauthorizedAccessExceptionRead access to the file is not permitted.
InvalidDataExceptionA problem occured while deserializing the XML data.

◆ LoadSafe()

static TrustDB ZeroInstall.Store.Trust.TrustDB.LoadSafe ( )
inlinestatic

Tries to load the TrustDB from the DefaultLocation. Automatically falls back to defaults on errors.

Returns
The loaded TrustDB or an empty TrustDB if there was a problem.

◆ Save() [1/2]

bool ZeroInstall.Store.Trust.TrustDB.Save ( )
inline

Saves the this TrustDB to the location it was loaded from if possible.

Returns
true if the file was saved; false if
Exceptions
IOExceptionA problem occured while writing the file.
UnauthorizedAccessExceptionWrite access to the file is not permitted.

◆ Save() [2/2]

void ZeroInstall.Store.Trust.TrustDB.Save ( string  path)
inline

Saves this TrustDB to a file.

Parameters
pathThe file to save to.
Exceptions
IOExceptionA problem occured while writing the file.
UnauthorizedAccessExceptionWrite access to the file is not permitted.

◆ TrustKey()

void ZeroInstall.Store.Trust.TrustDB.TrustKey ( string  fingerprint,
Domain  domain 
)
inline

Marks a key as trusted for a specific domain.

Parameters
fingerprintThe fingerprint of the key to check.
domainThe domain the key should be valid for.

◆ UntrustKey()

void ZeroInstall.Store.Trust.TrustDB.UntrustKey ( string  fingerprint,
Domain  domain 
)
inline

Marks a key as no longer trusted for a specific domain.

Parameters
fingerprintThe fingerprint of the key to check.
domainThe domain the key should be valid for.

The documentation for this class was generated from the following file: