Class SignedCatalog
- Namespace
- ZeroInstall.Publish
- Assembly
- ZeroInstall.Publish.dll
A wrapper around a Catalog adding and XSL stylesheet and a digital signature.
[Serializable]
public class SignedCatalog
- Inheritance
-
SignedCatalog
- Inherited Members
Constructors
SignedCatalog(Catalog, OpenPgpSecretKey?, IOpenPgp?)
Creates a new signed catalog.
public SignedCatalog(Catalog catalog, OpenPgpSecretKey? secretKey, IOpenPgp? openPgp = null)
Parameters
catalog
CatalogThe wrapped Catalog.
secretKey
OpenPgpSecretKeyThe secret key used to sign the Catalog;
null
for no signature.openPgp
IOpenPgpThe OpenPGP-compatible system used to create the signatures;
null
for default.
Properties
Catalog
The wrapped Catalog.
public Catalog Catalog { get; }
Property Value
SecretKey
The secret key used to sign the Catalog; null
for no signature.
public OpenPgpSecretKey? SecretKey { get; set; }
Property Value
Methods
Load(string)
Loads a Catalog from an XML file and identifies the signature (if any).
public static SignedCatalog Load(string path)
Parameters
path
stringThe file to load from.
Returns
- SignedCatalog
The loaded SignedCatalog.
Exceptions
- IOException
A problem occurred while reading the file.
- UnauthorizedAccessException
Read access to the file is not permitted.
- InvalidDataException
A problem occurred while deserializing an XML file.
Save(string, string?)
Saves Catalog to an XML file, adds the default stylesheet and sign it it with SecretKey (if specified).
public void Save(string path, string? passphrase = null)
Parameters
path
stringThe file to save in.
passphrase
stringThe passphrase to use to unlock the secret key; can be
null
if SecretKey isnull
.
Remarks
Writing and signing the catalog file are performed as an atomic operation (i.e. if signing fails an existing file remains unchanged).
Exceptions
- IOException
A problem occurred while writing the file.
- UnauthorizedAccessException
Write access to the file is not permitted.
- KeyNotFoundException
The specified SecretKey could not be found on the system.
- WrongPassphraseException
passphrase
was incorrect.