Table of Contents

Struct ManifestDigest

Namespace
ZeroInstall.Model
Assembly
ZeroInstall.Model.dll

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

[TypeConverter(typeof(ManifestDigestConverter))]
[Serializable]
public record struct ManifestDigest : IEquatable<ManifestDigest>
Implements
Inherited Members

Remarks

Stores digests of the manifest file using various hashing algorithms.

Constructors

ManifestDigest(string)

Creates a new manifest digest structure by parsing a string.

public ManifestDigest(string value)

Parameters

value string

One or more comma separated digest values.

Exceptions

NotSupportedException

value contains no known digest algorithms.

ManifestDigest(string?, string?, string?, string?)

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

public ManifestDigest(string? Sha1 = null, string? Sha1New = null, string? Sha256 = null, string? Sha256New = null)

Parameters

Sha1 string

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

Sha1New string

A SHA-1 hash of the new manifest format.

Sha256 string

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

Sha256New string

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

Remarks

Stores digests of the manifest file using various hashing algorithms.

Fields

Empty

The manifest digest of an empty directory.

public static readonly ManifestDigest Empty

Field Value

ManifestDigest

UnknownAlgorithms

Contains any unknown hash algorithms specified as pure XML attributes.

[NonSerialized]
public XmlAttribute[]? UnknownAlgorithms

Field Value

XmlAttribute[]

Properties

AvailableDigests

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

[Browsable(false)]
public IEnumerable<string> AvailableDigests { get; }

Property Value

IEnumerable<string>

Best

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

[Browsable(false)]
public string? Best { get; }

Property Value

string

Sha1

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

public string? Sha1 { readonly get; set; }

Property Value

string

Sha1New

A SHA-1 hash of the new manifest format.

public string? Sha1New { readonly get; set; }

Property Value

string

Sha256

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

public string? Sha256 { readonly get; set; }

Property Value

string

Sha256New

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

public string? Sha256New { readonly get; set; }

Property Value

string

Methods

PartialEquals(ManifestDigest)

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

public bool PartialEquals(ManifestDigest other)

Parameters

other ManifestDigest

Returns

bool

Remarks

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

ToString()

Returns the manifest digests in the form "sha1new=abc123,sha256new_ABC123,...". Safe for parsing!

public override string ToString()

Returns

string

TryParse(string)

Tries to parse a string containing a digest value. Does nothing if the corresponding algorithm is already set or if the string contains no known digest algorithm.

public void TryParse(string digest)

Parameters

digest string