Zero Install .NET API  2.18.2
ZeroInstall.Model.ManifestDigest Struct Reference

A manifest digest is a means of uniquely identifying an Implementation and verifying its contents. More...

Inheritance diagram for ZeroInstall.Model.ManifestDigest:

Public Member Functions

 ManifestDigest (string? sha1=null, string? sha1New=null, string? sha256=null, string? sha256New=null)
 Creates a new manifest digest structure with pre-set values. More...
 
 ManifestDigest (string id)
 Creates a new manifest digest structure by parsing an ID string. More...
 
void ParseID (string id)
 Parses an ID string, checking for digest values. The values will be added to this object if the corresponding digest value hasn't been set already. More...
 
override string ToString ()
 Returns the manifest digests in the form "Algorithm1=Hash1, Algorithm2=Hash2, ...". Not safe for parsing! More...
 
bool Equals (ManifestDigest other)
 
bool PartialEquals (ManifestDigest other)
 Indicates whether this digest is at least partially equal to another one. More...
 
override bool Equals (object? obj)
 
override int GetHashCode ()
 

Static Public Member Functions

static bool operator== (ManifestDigest left, ManifestDigest right)
 
static bool operator!= (ManifestDigest left, ManifestDigest right)
 

Public Attributes

string? Best => AvailableDigests.FirstOrDefault()
 Returns the best entry of AvailableDigests; null if there are none. More...
 
XmlAttribute[] UnknownAlgorithms
 Contains any unknown hash algorithms specified as pure XML attributes. More...
 

Static Public Attributes

static readonly ManifestDigest Empty = new ManifestDigest(sha1New: "da39a3ee5e6b4b0d3255bfef95601890afd80709", sha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", sha256New: "4OYMIQUY7QOBJGX36TEJS35ZEQT24QPEMSNZGTFESWMRW6CSXBKQ")
 The manifest digest of an empty directory. More...
 

Properties

string? Sha1 [get, set]
 A SHA-1 hash of the old manifest format. Not supported anymore! More...
 
string? Sha1New [get, set]
 A SHA-1 hash of the new manifest format. More...
 
string? Sha256 [get, set]
 A SHA-256 hash of the new manifest format. (most secure) More...
 
string? Sha256New [get, set]
 A SHA-256 hash of the new manifest format with a base32 encoding and no equals sign in the path. More...
 
IEnumerable< string > AvailableDigests [get]
 Lists all contained manifest digests sorted from best (safest) to worst. More...
 

Detailed Description

A manifest digest is a means of uniquely identifying an Implementation and verifying its contents.

Stores digests of the manifest file using various hashing algorithms.

Constructor & Destructor Documentation

◆ ManifestDigest() [1/2]

ZeroInstall.Model.ManifestDigest.ManifestDigest ( string?  sha1 = null,
string?  sha1New = null,
string?  sha256 = null,
string?  sha256New = null 
)
inline

Creates a new manifest digest structure with pre-set values.

Parameters
sha1A SHA-1 hash of the old manifest format.
sha1NewA SHA-1 hash of the new manifest format.
sha256A SHA-256 hash of the new manifest format. (most secure)
sha256NewA SHA-256 hash of the new manifest format with a base32 encoding and no equals sign in the path.

◆ ManifestDigest() [2/2]

ZeroInstall.Model.ManifestDigest.ManifestDigest ( string  id)
inline

Creates a new manifest digest structure by parsing an ID string.

Parameters
idThe ID string to parse. Digest values start with their format name followed by an equals sign and the actual hash.
Exceptions
NotSupportedExceptionid is not a valid manifest digest.

Member Function Documentation

◆ ParseID()

void ZeroInstall.Model.ManifestDigest.ParseID ( string  id)
inline

Parses an ID string, checking for digest values. The values will be added to this object if the corresponding digest value hasn't been set already.

Parameters
idThe ID string to parse. Digest values start with their format name followed by an equals sign and the actual hash.

◆ PartialEquals()

bool ZeroInstall.Model.ManifestDigest.PartialEquals ( ManifestDigest  other)
inline

Indicates whether this digest is at least partially equal to another one.

Two digests are considered partially equal if at least one digest format matches and no values are contradictory.

◆ ToString()

override string ZeroInstall.Model.ManifestDigest.ToString ( )
inline

Returns the manifest digests in the form "Algorithm1=Hash1, Algorithm2=Hash2, ...". Not safe for parsing!

Member Data Documentation

◆ Best

string? ZeroInstall.Model.ManifestDigest.Best => AvailableDigests.FirstOrDefault()

Returns the best entry of AvailableDigests; null if there are none.

◆ Empty

readonly ManifestDigest ZeroInstall.Model.ManifestDigest.Empty = new ManifestDigest(sha1New: "da39a3ee5e6b4b0d3255bfef95601890afd80709", sha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", sha256New: "4OYMIQUY7QOBJGX36TEJS35ZEQT24QPEMSNZGTFESWMRW6CSXBKQ")
static

The manifest digest of an empty directory.

◆ UnknownAlgorithms

XmlAttribute [] ZeroInstall.Model.ManifestDigest.UnknownAlgorithms

Contains any unknown hash algorithms specified as pure XML attributes.

Property Documentation

◆ AvailableDigests

IEnumerable<string> ZeroInstall.Model.ManifestDigest.AvailableDigests
get

Lists all contained manifest digests sorted from best (safest) to worst.

◆ Sha1

string? ZeroInstall.Model.ManifestDigest.Sha1
getset

A SHA-1 hash of the old manifest format. Not supported anymore!

◆ Sha1New

string? ZeroInstall.Model.ManifestDigest.Sha1New
getset

A SHA-1 hash of the new manifest format.

◆ Sha256

string? ZeroInstall.Model.ManifestDigest.Sha256
getset

A SHA-256 hash of the new manifest format. (most secure)

◆ Sha256New

string? ZeroInstall.Model.ManifestDigest.Sha256New
getset

A SHA-256 hash of the new manifest format with a base32 encoding and no equals sign in the path.


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