Class SignedCatalog
A wrapper around a Catalog adding and XSL stylesheet and a digital signature.
Namespace: ZeroInstall.Publish
Assembly: ZeroInstall.Publish.dll
Syntax
public class SignedCatalog : Object
Constructors
SignedCatalog(Catalog, OpenPgpSecretKey, IOpenPgp)
Creates a new signed catalog.
Declaration
public SignedCatalog(Catalog catalog, OpenPgpSecretKey secretKey, IOpenPgp openPgp = null)
Parameters
Type | Name | Description |
---|---|---|
Catalog | catalog | The wrapped Catalog. |
OpenPgpSecretKey | secretKey | The secret key used to sign the Catalog; |
IOpenPgp | openPgp | The OpenPGP-compatible system used to create the signatures; |
Properties
Catalog
The wrapped Catalog.
Declaration
public Catalog Catalog { get; }
Property Value
Type | Description |
---|---|
Catalog |
SecretKey
The secret key used to sign the Catalog; null
for no signature.
Declaration
public OpenPgpSecretKey SecretKey { get; set; }
Property Value
Type | Description |
---|---|
OpenPgpSecretKey |
Methods
Load(String)
Loads a Catalog from an XML file and identifies the signature (if any).
Declaration
public static SignedCatalog Load(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | The file to load from. |
Returns
Type | Description |
---|---|
SignedCatalog | The loaded SignedCatalog. |
Exceptions
Type | Condition |
---|---|
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).
Declaration
public void Save(string path, string passphrase = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The file to save in. |
String | passphrase | The passphrase to use to unlock the secret key; can be |
Remarks
Writing and signing the catalog file are performed as an atomic operation (i.e. if signing fails an existing file remains unchanged).
Exceptions
Type | Condition |
---|---|
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 |
|