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

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

Public Member Functions

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

Static Public Member Functions

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

Properties

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

Detailed Description

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

Constructor & Destructor Documentation

◆ SignedFeed()

ZeroInstall.Publish.SignedFeed.SignedFeed ( Feed  feed,
OpenPgpSecretKey secretKey = null,
IOpenPgp openPgp = null 
)
inline

Creates a new signed feed.

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

Member Function Documentation

◆ Load()

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

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

Parameters
pathThe file to load from.
Returns
The loaded SignedFeed.
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.SignedFeed.Save ( string  path,
string?  passphrase = null 
)
inline

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

Writing and signing the feed 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: