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