Zero Install .NET API 2.20.0
ZeroInstall.Store.Manifests.ManifestFormat Class Referenceabstract

Abstract class to encapsulate the differences between the different formats that can be used to save and load Manifests. More...

Public Member Functions

override string ToString ()
 
string DigestContent (Stream stream)
 Generates the digest of a implementation file as used within the manifest file. More...
 
string DigestManifest (Manifest manifest)
 Generates the digest of a manifest. More...
 

Static Public Member Functions

static ManifestFormat FromPrefix (string id)
 Selects the correct ManifestFormat based on the digest prefix. More...
 

Static Public Attributes

static readonly ManifestFormat[] All = {Sha256New, Sha256, Sha1New}
 All currently supported ManifestFormats listed from best (safest) to worst.
 

Protected Member Functions

abstract HashAlgorithm GetHashAlgorithm ()
 Retrieves a new instance of the hashing algorithm used for generating digests.
 
virtual string SerializeContentDigest (byte[] hash)
 Serializes a hash as digest of an implementation file as used within the manifest file.
 
virtual string SerializeManifestDigest (byte[] hash)
 Serializes a hash as a digest of a manifest file as used for the implementation directory name.
 

Properties

static ManifestFormat Sha1New = new Sha1NewFormat() [get]
 The ManifestFormat to use for ManifestDigest.Sha1New.
 
static ManifestFormat Sha256 = new Sha256Format() [get]
 The ManifestFormat to use for ManifestDigest.Sha256.
 
static ManifestFormat Sha256New = new Sha256NewFormat() [get]
 The ManifestFormat to use for ManifestDigest.Sha256New.
 
abstract string Prefix [get]
 The prefix used to identify the format (e.g. "sha256").
 
virtual string Separator [get]
 The separator placed between the Prefix and the actual digest.
 

Detailed Description

Abstract class to encapsulate the differences between the different formats that can be used to save and load Manifests.

Comprises: The digest method used and the format specification used to serialize and deserialize manifests.

Member Function Documentation

◆ DigestContent()

string ZeroInstall.Store.Manifests.ManifestFormat.DigestContent ( Stream  stream)
inline

Generates the digest of a implementation file as used within the manifest file.

Parameters
streamThe content of the implementation file.
Returns
A string representation of the digest.

◆ DigestManifest()

string ZeroInstall.Store.Manifests.ManifestFormat.DigestManifest ( Manifest  manifest)

Generates the digest of a manifest.

Returns
A string representation of the digest.

◆ FromPrefix()

static ManifestFormat ZeroInstall.Store.Manifests.ManifestFormat.FromPrefix ( string  id)
inlinestatic

Selects the correct ManifestFormat based on the digest prefix.

Parameters
idThe digest id to extract the prefix from or only the prefix.
Exceptions
ArgumentExceptionid is no known algorithm prefix.

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