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
stringOne 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
stringA SHA-1 hash of the old manifest format. Not supported anymore!
Sha1New
stringA SHA-1 hash of the new manifest format.
Sha256
stringA SHA-256 hash of the new manifest format. (most secure)
Sha256New
stringA 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
UnknownAlgorithms
Contains any unknown hash algorithms specified as pure XML attributes.
[NonSerialized]
public XmlAttribute[]? UnknownAlgorithms
Field Value
Properties
AvailableDigests
Lists all contained manifest digests sorted from best (safest) to worst.
[Browsable(false)]
public IEnumerable<string> AvailableDigests { get; }
Property Value
Best
Returns the best entry of AvailableDigests; null
if there are none.
[Browsable(false)]
public string? Best { get; }
Property Value
Sha1
A SHA-1 hash of the old manifest format. Not supported anymore!
public string? Sha1 { readonly get; set; }
Property Value
Sha1New
A SHA-1 hash of the new manifest format.
public string? Sha1New { readonly get; set; }
Property Value
Sha256
A SHA-256 hash of the new manifest format. (most secure)
public string? Sha256 { readonly get; set; }
Property Value
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
Methods
PartialEquals(ManifestDigest)
Indicates whether this digest is at least partially equal to another one.
public bool PartialEquals(ManifestDigest other)
Parameters
other
ManifestDigest
Returns
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
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