Show / Hide Table of Contents

Class ManifestDigest

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

Inheritance
Object
ManifestDigest
Implements
IEquatable<ManifestDigest>
Namespace: ZeroInstall.Model
Assembly: ZeroInstall.Model.dll
Syntax
public sealed class ManifestDigest : ValueType
Remarks

Stores digests of the manifest file using various hashing algorithms.

Constructors

ManifestDigest(String)

Creates a new manifest digest structure by parsing a string.

Declaration
public ManifestDigest(string value)
Parameters
Type Name Description
String value

One or more comma separated digest values.

Exceptions
Type Condition
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.

Declaration
public ManifestDigest(string Sha1 = null, string Sha1New = null, string Sha256 = null, string Sha256New = null)
Parameters
Type Name Description
String Sha1

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

String Sha1New

A SHA-1 hash of the new manifest format.

String Sha256

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

String Sha256New

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.

Declaration
public static readonly ManifestDigest Empty
Field Value
Type Description
ManifestDigest

UnknownAlgorithms

Contains any unknown hash algorithms specified as pure XML attributes.

Declaration
public XmlAttribute[] UnknownAlgorithms
Field Value
Type Description
XmlAttribute[]

Properties

AvailableDigests

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

Declaration
public IEnumerable<string> AvailableDigests { get; }
Property Value
Type Description
IEnumerable<String>

Best

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

Declaration
public string Best { get; }
Property Value
Type Description
String

Sha1

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

Declaration
public string Sha1 { get; set; }
Property Value
Type Description
String

Sha1New

A SHA-1 hash of the new manifest format.

Declaration
public string Sha1New { get; set; }
Property Value
Type Description
String

Sha256

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

Declaration
public string Sha256 { get; set; }
Property Value
Type Description
String

Sha256New

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

Declaration
public string Sha256New { get; set; }
Property Value
Type Description
String

Methods

Deconstruct(out String, out String, out String, out String)

Declaration
public void Deconstruct(out string Sha1, out string Sha1New, out string Sha256, out string Sha256New)
Parameters
Type Name Description
String Sha1
String Sha1New
String Sha256
String Sha256New

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
Object obj
Returns
Type Description
Boolean

Equals(ManifestDigest)

Declaration
public bool Equals(ManifestDigest other)
Parameters
Type Name Description
ManifestDigest other
Returns
Type Description
Boolean

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
Int32

PartialEquals(ManifestDigest)

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

Declaration
public bool PartialEquals(ManifestDigest other)
Parameters
Type Name Description
ManifestDigest other
Returns
Type Description
Boolean
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!

Declaration
public override string ToString()
Returns
Type Description
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.

Declaration
public void TryParse(string digest)
Parameters
Type Name Description
String digest

Operators

Equality(ManifestDigest, ManifestDigest)

Declaration
public static bool operator ==(ManifestDigest left, ManifestDigest right)
Parameters
Type Name Description
ManifestDigest left
ManifestDigest right
Returns
Type Description
Boolean

Inequality(ManifestDigest, ManifestDigest)

Declaration
public static bool operator !=(ManifestDigest left, ManifestDigest right)
Parameters
Type Name Description
ManifestDigest left
ManifestDigest right
Returns
Type Description
Boolean

Implements

System.IEquatable<T>
In This Article
Back to top Copyright Bastian Eicher et al