Zero Install .NET API 2.20.0
ZeroInstall.Publish.SignedCatalog Class Reference

A wrapper around a Catalog adding and XSL stylesheet and a digital signature. More...

Public Member Functions

 SignedCatalog (Catalog catalog, OpenPgpSecretKey? secretKey, IOpenPgp? openPgp=null)
 Creates a new signed catalog. More...
 
void Save (string path, string? passphrase=null)
 Saves Catalog to an XML file, adds the default stylesheet and sign it it with SecretKey (if specified). More...
 

Static Public Member Functions

static SignedCatalog Load (string path)
 Loads a Catalog from an XML file and identifies the signature (if any). More...
 

Properties

Catalog Catalog [get]
 The wrapped Catalog.
 
OpenPgpSecretKeySecretKey [getset]
 The secret key used to sign the Catalog; null for no signature.
 

Detailed Description

A wrapper around a Catalog adding and XSL stylesheet and a digital signature.

Constructor & Destructor Documentation

◆ SignedCatalog()

ZeroInstall.Publish.SignedCatalog.SignedCatalog ( Catalog  catalog,
OpenPgpSecretKey secretKey,
IOpenPgp openPgp = null 
)
inline

Creates a new signed catalog.

Parameters
catalogThe wrapped Catalog.
secretKeyThe secret key used to sign the Catalog; null for no signature.
openPgpThe OpenPGP-compatible system used to create the signatures; null for default.

Member Function Documentation

◆ Load()

static SignedCatalog ZeroInstall.Publish.SignedCatalog.Load ( string  path)
inlinestatic

Loads a Catalog from an XML file and identifies the signature (if any).

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

◆ Save()

void ZeroInstall.Publish.SignedCatalog.Save ( string  path,
string?  passphrase = null 
)
inline

Saves Catalog to an XML file, adds the default stylesheet and sign it it with SecretKey (if specified).

Writing and signing the catalog file are performed as an atomic operation (i.e. if signing fails an existing file remains unchanged).

Parameters
pathThe file to save in.
passphraseThe passphrase to use to unlock the secret key; can be null if SecretKey is null.
Exceptions
IOExceptionA problem occurred while writing the file.
UnauthorizedAccessExceptionWrite access to the file is not permitted.
KeyNotFoundExceptionThe specified SecretKey could not be found on the system.
WrongPassphraseExceptionpassphrase was incorrect.

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