C# Class Goedel.Cryptography.UDF

Class implementing the Uniform Data Fingerprint spec.
Show file Open project: hallambaker/Mathematical-Mesh

Public Methods

Method Description
From ( string ContentType, byte Data, int Bits ) : byte[]

Compute UDF from binary data and content type with specified precision.

FromEscrowed ( byte Data, int Bits ) : byte[]

Calculate a UDF fingerprint from a secret key used to escrow a private key in the mesh.

FromKeyInfo ( byte Data ) : byte[]

Calculate a UDF fingerprint from a PKIX KeyInfo blob with specified precision.

FromKeyInfo ( byte Data, int Bits ) : byte[]

Calculate a UDF fingerprint from a PKIX KeyInfo blob with specified precision.

Random ( ) : string

Return a random sequence as a UDF

Random ( int Bits ) : string

Return a random sequence as a UDF

SHA1 ( byte Data ) : byte[]

Calculate a SHA-1 fingerprint

SHA256 ( byte Data ) : byte[]

Calculate a SHA-1 fingerprint

ToString ( byte Data ) : string

Convert a binary UDF to a string.

ToString ( string ContentType, byte Data, int Bits ) : string

Calculate a UDF fingerprint from an OpenPGP key with specified precision.

Validate ( string Test, string Value ) : void

Check that a UDF fingerprint satisfies a test value. At present the test must be exact. It is possible that this can be relaxed so that a longer fingerprint will satisfy a shorter one.

Method Details

From() public static method

Compute UDF from binary data and content type with specified precision.
public static From ( string ContentType, byte Data, int Bits ) : byte[]
ContentType string MIME media type. See /// http://www.iana.org/assignments/media-types/media-types.xhtml for list.
Data byte Data to be fingerprinted.
Bits int Precision, must be a multiple of 25 bits.
return byte[]

FromEscrowed() public static method

Calculate a UDF fingerprint from a secret key used to escrow a private key in the mesh.
public static FromEscrowed ( byte Data, int Bits ) : byte[]
Data byte Data to be fingerprinted.
Bits int Precision, must be a multiple of 25 bits.
return byte[]

FromKeyInfo() public static method

Calculate a UDF fingerprint from a PKIX KeyInfo blob with specified precision.
public static FromKeyInfo ( byte Data ) : byte[]
Data byte Data to be fingerprinted.
return byte[]

FromKeyInfo() public static method

Calculate a UDF fingerprint from a PKIX KeyInfo blob with specified precision.
public static FromKeyInfo ( byte Data, int Bits ) : byte[]
Data byte Data to be fingerprinted.
Bits int Precision, must be a multiple of 25 bits.
return byte[]

Random() public static method

Return a random sequence as a UDF
public static Random ( ) : string
return string

Random() public static method

Return a random sequence as a UDF
public static Random ( int Bits ) : string
Bits int
return string

SHA1() public static method

Calculate a SHA-1 fingerprint
public static SHA1 ( byte Data ) : byte[]
Data byte Data to be fingerprinted
return byte[]

SHA256() public static method

Calculate a SHA-1 fingerprint
public static SHA256 ( byte Data ) : byte[]
Data byte Data to be fingerprinted
return byte[]

ToString() public static method

Convert a binary UDF to a string.
public static ToString ( byte Data ) : string
Data byte
return string

ToString() public static method

Calculate a UDF fingerprint from an OpenPGP key with specified precision.
public static ToString ( string ContentType, byte Data, int Bits ) : string
ContentType string MIME media type of data being fingerprinted.
Data byte Data to be fingerprinted.
Bits int Precision, must be a multiple of 25 bits.
return string

Validate() public static method

Check that a UDF fingerprint satisfies a test value. At present the test must be exact. It is possible that this can be relaxed so that a longer fingerprint will satisfy a shorter one.
public static Validate ( string Test, string Value ) : void
Test string
Value string
return void