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 an ID string.

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

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

Exceptions
Type Condition
NotSupportedException

id is not a valid manifest digest.

ManifestDigest(String, String, String, String)

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

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.

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.

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

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

ParseID(String)

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.

Declaration
public void ParseID(string id)
Parameters
Type Name Description
String id

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

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 format matches and no values are contradictory.

ToString()

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

Declaration
public override string ToString()
Returns
Type Description
String

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