Class TrustManager
- Namespace
- ZeroInstall.Services.Feeds
- Assembly
- ZeroInstall.Services.dll
Methods for verifying signatures and user trust.
public class TrustManager : ITrustManager
- Inheritance
-
TrustManager
- Implements
- Inherited Members
Remarks
This class is immutable and thread-safe.
Constructors
TrustManager(TrustDB, Config, IOpenPgp, IFeedCache, ITaskHandler)
Methods for verifying signatures and user trust.
public TrustManager(TrustDB trustDB, Config config, IOpenPgp openPgp, IFeedCache feedCache, ITaskHandler handler)
Parameters
trustDBTrustDBconfigConfigopenPgpIOpenPgpfeedCacheIFeedCachehandlerITaskHandler
Remarks
This class is immutable and thread-safe.
Methods
CheckTrust(byte[], FeedUri, OpenPgpKeyCallback?)
Checks whether a remote feed or catalog file has a valid and trusted signature. Downloads missing GPG keys for verification and interactively asks the user to approve new keys.
public ValidSignature CheckTrust(byte[] data, FeedUri uri, OpenPgpKeyCallback? keyCallback = null)
Parameters
databyte[]The data of the file.
uriFeedUriThe URI the
dataoriginally came from.keyCallbackOpenPgpKeyCallbackCallback for reading a specific OpenPGP public key file.
Returns
- ValidSignature
The first valid and trusted signature found on the feed.
Exceptions
- UriFormatException
uriis a local file.- OperationCanceledException
The user canceled the task.
- WebException
A key file could not be downloaded from the internet.
- SignatureException
No trusted signature was found.
- IOException
A problem occurred while writing trust configuration.
- UnauthorizedAccessException
Write access to the trust configuration is not permitted.