Class SignedFeed
A wrapper around a Feed adding and XSL stylesheet and a digital signature.
Namespace: ZeroInstall.Publish
Assembly: ZeroInstall.Publish.dll
Syntax
public class SignedFeed : Object
Constructors
SignedFeed(Feed, OpenPgpSecretKey, IOpenPgp)
Creates a new signed feed.
Declaration
public SignedFeed(Feed feed, OpenPgpSecretKey secretKey = null, IOpenPgp openPgp = null)
Parameters
Type | Name | Description |
---|---|---|
Feed | feed | The wrapped Feed. |
OpenPgpSecretKey | secretKey | The secret key used to sign the Feed; |
IOpenPgp | openPgp | The OpenPGP-compatible system used to create the signatures; |
Properties
Feed
The wrapped Feed.
Declaration
public Feed Feed { get; }
Property Value
Type | Description |
---|---|
Feed |
SecretKey
The secret key used to sign the Feed; null
for no signature.
Declaration
public OpenPgpSecretKey SecretKey { get; set; }
Property Value
Type | Description |
---|---|
OpenPgpSecretKey |
Methods
Load(String)
Loads a Feed from an XML file and identifies the signature (if any).
Declaration
public static SignedFeed Load(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | The file to load from. |
Returns
Type | Description |
---|---|
SignedFeed | The loaded SignedFeed. |
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 Feed 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 feed 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 |
|