Verification and Auditing


The verification methods provided are to check if the hash conforms to apostille standards and to ensure the integrity of the file contents.

To check if the hash is an apostille hash

import { Verifier } from 'apostille-library';

// Some hashed payload
const unknownHash;

// Returns true if it conforms to apostille format, false otherwise

To determine if the hash is public or private apostille

import { Verifier } from 'apostille-library';

const apostilleHash;

// Returns true if public apostille, false otherwise

// Returns true if private apostille, false otherwise

Public Apostille

To audit public apostille, we need the apostille hash and the file contents.

The apostille hash is found in hashedFileContent from the Using Public Apostille example.

const apostilleHash = hashedFileContent.message;
const fileContent = CryptoJS.enc.Utf8.parse('Public apostille is awesome !');

// Returns true
Verifier.verifyPublicApostille(apostilleHash, fileContent);

Private Apostille

The procedure is similar in private apostille. However, we also need the public account of the signer of the hash.

In the Coloring example, we use the apostille account to sign the payload.

const fileContent = CryptoJS.enc.Utf8.parse('A certificate for my LAMY 2000');
apostilleHttp.getCreationTransaction(apostillePublicAccount.publicAccount).then((creationTransaction) => {
    const apostilleHash = creationTransaction.message;
    Verifier.verifyPrivateApostille(apostillePublicAccount, fileContent, apostilleHash);
Last Updated: 11/28/2018, 6:02:21 AM