C# Класс Cryptid.CandidateDelegate

Handles all CandidateDelegate; Basically, any action you need to perform on a Candidate should be done here.
Показать файл Открыть проект

Открытые методы

Метод Описание
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

Описание методов

EnrollCandidate() публичный статический Метод

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
Результат byte[]

FullVerifyFromChain() публичный статический Метод

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
Результат float

GenerateExtIDs() публичный статический Метод

Generates the ExtIDs for a packed candidate
public static GenerateExtIDs ( byte packedCandidate ) : byte[][]
packedCandidate byte The packed candidate to generate for
Результат byte[][]

GetCandidateChainHistory() публичный статический Метод

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
Результат List

GetCandidateUpdatedRecords() публичный статический Метод

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
Результат List

GetOldVersionRecords() публичный статический Метод

public static GetOldVersionRecords ( byte chainId, RSAParameters pubKey ) : List
chainId byte
pubKey System.Security.Cryptography.RSAParameters The public key to verify the data with
Результат List

GetPackedCandidate() публичный статический Метод

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
Результат byte[]

Pack() публичный статический Метод

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
Результат byte[]

Unpack() публичный статический Метод

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
Результат Candidate

UpdateCandidate() публичный статический Метод

- 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
Результат byte[]

VerifyFingerprint() публичный статический Метод

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
Результат float

VerifySignature() публичный статический Метод

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
Результат bool