Table of Contents

Class ManifestFormat

Namespace
ZeroInstall.Store.Manifests
Assembly
ZeroInstall.Store.dll

Abstract class to encapsulate the differences between the different formats that can be used to save and load Manifests.

[Serializable]
public abstract class ManifestFormat
Inheritance
ManifestFormat
Inherited Members

Remarks

Comprises: The digest method used and the format specification used to serialize and deserialize manifests.

Fields

All

All currently supported ManifestFormats listed from best (safest) to worst.

public static readonly ManifestFormat[] All

Field Value

ManifestFormat[]

Properties

Prefix

The prefix used to identify the format (e.g. "sha256").

public abstract string Prefix { get; }

Property Value

string

Separator

The separator placed between the Prefix and the actual digest.

public virtual string Separator { get; }

Property Value

string

Sha1New

The ManifestFormat to use for Sha1New.

public static ManifestFormat Sha1New { get; }

Property Value

ManifestFormat

Sha256

The ManifestFormat to use for Sha256.

public static ManifestFormat Sha256 { get; }

Property Value

ManifestFormat

Sha256New

The ManifestFormat to use for Sha256New.

public static ManifestFormat Sha256New { get; }

Property Value

ManifestFormat

Methods

DigestContent(Stream)

Generates the digest of a implementation file as used within the manifest file.

public string DigestContent(Stream stream)

Parameters

stream Stream

The content of the implementation file.

Returns

string

A string representation of the digest.

DigestManifest(Manifest)

Generates the digest of a manifest.

public string DigestManifest(Manifest manifest)

Parameters

manifest Manifest

Returns

string

A string representation of the digest.

FromPrefix(string)

Selects the correct ManifestFormat based on the digest prefix.

public static ManifestFormat FromPrefix(string id)

Parameters

id string

The digest id to extract the prefix from or only the prefix.

Returns

ManifestFormat

Exceptions

NotSupportedException

id does not have a supported algorithm prefix.

GetHashAlgorithm()

Retrieves a new instance of the hashing algorithm used for generating digests.

protected abstract HashAlgorithm GetHashAlgorithm()

Returns

HashAlgorithm

SerializeContentDigest(byte[])

Serializes a hash as digest of an implementation file as used within the manifest file.

protected virtual string SerializeContentDigest(byte[] hash)

Parameters

hash byte[]

Returns

string

SerializeManifestDigest(byte[])

Serializes a hash as a digest of a manifest file as used for the implementation directory name.

protected virtual string SerializeManifestDigest(byte[] hash)

Parameters

hash byte[]

Returns

string

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.