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

Helper methods for manipulating Feeds. More...

Static Public Member Functions

static void DeployStylesheet (string path, string name)
 Writes an XSL stylesheet with its accompanying CSS file unless there is already an XSL in place. More...
 
static void SignFeed (Stream stream, OpenPgpSecretKey secretKey, string? passphrase, IOpenPgp openPgp)
 Adds a Base64 signature to a feed or catalog stream. More...
 
static ? OpenPgpSecretKey GetKey (string path, IOpenPgp openPgp)
 Determines the key used to sign a feed or catalog file. Only uses the first signature if more than one is present. More...
 

Detailed Description

Helper methods for manipulating Feeds.

Member Function Documentation

◆ DeployStylesheet()

static void ZeroInstall.Publish.FeedUtils.DeployStylesheet ( string  path,
string  name 
)
inlinestatic

Writes an XSL stylesheet with its accompanying CSS file unless there is already an XSL in place.

Parameters
pathThe directory to write the stylesheet files to.
nameThe name of the stylesheet to deploy. Must be "feed" or "catalog".
Exceptions
IOExceptionFailed to write the stylesheet files.
UnauthorizedAccessExceptionWrite access to the directory is not permitted.

◆ GetKey()

static ? OpenPgpSecretKey ZeroInstall.Publish.FeedUtils.GetKey ( string  path,
IOpenPgp  openPgp 
)
inlinestatic

Determines the key used to sign a feed or catalog file. Only uses the first signature if more than one is present.

Parameters
pathThe feed or catalog file to check for signatures.
openPgpThe OpenPGP-compatible system used to validate the signatures.
Returns
The key used to sign the file; null if the file was not signed.
Exceptions
FileNotFoundExceptionThe file file could not be found.
IOExceptionThe file could not be read.
UnauthorizedAccessExceptionRead access to the file is not permitted.

◆ SignFeed()

static void ZeroInstall.Publish.FeedUtils.SignFeed ( Stream  stream,
OpenPgpSecretKey  secretKey,
string?  passphrase,
IOpenPgp  openPgp 
)
inlinestatic

Adds a Base64 signature to a feed or catalog stream.

Parameters
streamThe feed or catalog to sign.
secretKeyThe secret key to use for signing the file.
passphraseThe passphrase to use to unlock the key.
openPgpThe OpenPGP-compatible system used to create signatures.
Exceptions
IOExceptionThe file could not be read or written.
UnauthorizedAccessExceptionRead or write access to the file is not permitted.
KeyNotFoundExceptionThe specified secretKey could not be found on the system.
WrongPassphraseExceptionpassphrase was incorrect.

The file is not parsed before signing; invalid XML files are signed as well. The existing file must end with a line break. Old signatures are not removed.


The documentation for this class was generated from the following file: