C# Class Cryptid.CandidateDelegate

Handles all CandidateDelegate; Basically, any action you need to perform on a Candidate should be done here.
Afficher le fichier Open project: CryptidID/Cryptid

Méthodes publiques

Méthode Description
EnrollCandidate ( Candidate c, string password, RSAParameters privKey ) : byte[]

Enroll a candidate a to Factom. A new chain is created and the candidate data is packed and split into entries for that chain. This operation is irreversable.

FullVerifyFromChain ( byte chainId, string password, SourceAFIS.Simple.Fingerprint fp, RSAParameters publicKey ) : float

Fully verify a user from a chain. Full verify includes fingerprint, password and signature check

GenerateExtIDs ( byte packedCandidate ) : byte[][]

Generates the ExtIDs for a packed candidate

GetCandidateChainHistory ( byte chainId, RSAParameters pubKey ) : List

Get all the chains used by a candidate (Follows OldVersionRecords and UpdatedRecords)

GetCandidateUpdatedRecords ( byte chainId, RSAParameters pubKey ) : List

Get all Candidate update records in a chain

GetOldVersionRecords ( byte chainId, RSAParameters pubKey ) : List

GetPackedCandidate ( byte chainId ) : byte[]

Gets the candidates packed bytes from the specified chain

Pack ( Candidate c, string password, RSAParameters privKey ) : byte[]

Pack a candidate object into storable data

Unpack ( byte packed, string password, RSAParameters pubKey ) : Candidate

Unpack a candidate object from storable data

UpdateCandidate ( Candidate newCandidate, string password, SourceAFIS.Simple.Fingerprint fp, RSAParameters privKey, byte chainToUpdate ) : byte[]

- Verifies that we are allowed to update this chain - Enrolls a new candidate chain with a CandidateOldVersionRecord referencing the old chain - Adds a OldVersionRecord to the old chain referencing the new chain - Adds a ChainUpdateRecord to the chain requesting update, forwarding it to the new chain. This operation is irreversable.

VerifyFingerprint ( Candidate c, SourceAFIS.Simple.Fingerprint fp ) : float

Verify a candidates fingerprint

VerifySignature ( byte packed, RSAParameters pubKey ) : bool

Verify the signature of packed candidate data

Method Details

EnrollCandidate() public static méthode

Enroll a candidate a to Factom. A new chain is created and the candidate data is packed and split into entries for that chain. This operation is irreversable.
public static EnrollCandidate ( Candidate c, string password, RSAParameters privKey ) : byte[]
c Candidate The candidate to enroll
password string The password provided by the candidate
privKey System.Security.Cryptography.RSAParameters The private key to pack the data with
Résultat byte[]

FullVerifyFromChain() public static méthode

Fully verify a user from a chain. Full verify includes fingerprint, password and signature check
public static FullVerifyFromChain ( byte chainId, string password, SourceAFIS.Simple.Fingerprint fp, RSAParameters publicKey ) : float
chainId byte The id of the chain to verify
password string The candidates password
fp SourceAFIS.Simple.Fingerprint The candidates fingerprint
publicKey System.Security.Cryptography.RSAParameters The public key to verify the data with
Résultat float

GenerateExtIDs() public static méthode

Generates the ExtIDs for a packed candidate
public static GenerateExtIDs ( byte packedCandidate ) : byte[][]
packedCandidate byte The packed candidate to generate for
Résultat byte[][]

GetCandidateChainHistory() public static méthode

Get all the chains used by a candidate (Follows OldVersionRecords and UpdatedRecords)
public static GetCandidateChainHistory ( byte chainId, RSAParameters pubKey ) : List
chainId byte The id of a chain owned by the candidate
pubKey System.Security.Cryptography.RSAParameters The public key to verify the data with
Résultat List

GetCandidateUpdatedRecords() public static méthode

Get all Candidate update records in a chain
public static GetCandidateUpdatedRecords ( byte chainId, RSAParameters pubKey ) : List
chainId byte
pubKey System.Security.Cryptography.RSAParameters The public key to verify the data with
Résultat List

GetOldVersionRecords() public static méthode

public static GetOldVersionRecords ( byte chainId, RSAParameters pubKey ) : List
chainId byte
pubKey System.Security.Cryptography.RSAParameters The public key to verify the data with
Résultat List

GetPackedCandidate() public static méthode

Gets the candidates packed bytes from the specified chain
public static GetPackedCandidate ( byte chainId ) : byte[]
chainId byte The id of the chain to get the candidate data from
Résultat byte[]

Pack() public static méthode

Pack a candidate object into storable data
public static Pack ( Candidate c, string password, RSAParameters privKey ) : byte[]
c Candidate The candidate object to pack
password string The password provided by the candidate
privKey System.Security.Cryptography.RSAParameters The private key to sign the data with
Résultat byte[]

Unpack() public static méthode

Unpack a candidate object from storable data
public static Unpack ( byte packed, string password, RSAParameters pubKey ) : Candidate
packed byte The packed candidate data
password string The password provided by the candidate
pubKey System.Security.Cryptography.RSAParameters The public key to verify the data with
Résultat Candidate

UpdateCandidate() public static méthode

- Verifies that we are allowed to update this chain - Enrolls a new candidate chain with a CandidateOldVersionRecord referencing the old chain - Adds a OldVersionRecord to the old chain referencing the new chain - Adds a ChainUpdateRecord to the chain requesting update, forwarding it to the new chain. This operation is irreversable.
public static UpdateCandidate ( Candidate newCandidate, string password, SourceAFIS.Simple.Fingerprint fp, RSAParameters privKey, byte chainToUpdate ) : byte[]
newCandidate Candidate The updated candidate information
password string The password provided by the candidate
fp SourceAFIS.Simple.Fingerprint The fingerprint to verify against
privKey System.Security.Cryptography.RSAParameters The private key to pack the data with
chainToUpdate byte The chain ID of the chain to be updated
Résultat byte[]

VerifyFingerprint() public static méthode

Verify a candidates fingerprint
public static VerifyFingerprint ( Candidate c, SourceAFIS.Simple.Fingerprint fp ) : float
c Candidate The candidate to compare against
fp SourceAFIS.Simple.Fingerprint The provided fingerprint
Résultat float

VerifySignature() public static méthode

Verify the signature of packed candidate data
public static VerifySignature ( byte packed, RSAParameters pubKey ) : bool
packed byte The packed candidate data
pubKey System.Security.Cryptography.RSAParameters The public key to verify with
Résultat bool