contract/business/NotarizeOps.js
/**
     * 
     * @param {BeanDataBlock} blockData Data block with the set of process information.
     */
@param {BeanDataBlock} blockData Data block with the set of process information.
@param { BeanDataBlock } blockData Data block with the set of process information .
async verifyValidator(blockData) {
        let validator = blockData.validator;
        let hashFromUserInfos = BeanUser.generateHashFromUserInfos(validator);
        logWrite('[verifyValidator] hashFromUserInfos: ' + hashFromUserInfos);
        let signatureOfUserInfos = validator.signatureOfUserInfos;
        logWrite('[verifyValidator] signatureOfUserInfos: ' + signatureOfUserInfos);
        let verifyHashValidator = false;
        verifyHashValidator = await EccUtil.verifyMessageSigned(hashFromUserInfos, signatureOfUserInfos, validator);
        if (!verifyHashValidator) {
            let msgError = 'Validator Data Incorrect. Validator Publick Key Not Validated';
            logWrite(`[verifyValidator] Message: ${msgError}`);
            throw msgError;
        }
        logWrite('[verifyValidator] Validator Data Ckecked');
        return verifyHashValidator;
    }
async verifyValidator ( blockData ) { let validator = blockData . validator ; let hashFromUserInfos = BeanUser . generateHashFromUserInfos ( validator ) ; logWrite ( '[verifyValidator] hashFromUserInfos: ' + hashFromUserInfos ) ; let signatureOfUserInfos = validator . signatureOfUserInfos ; logWrite ( '[verifyValidator] signatureOfUserInfos: ' + signatureOfUserInfos ) ; let verifyHashValidator = false ; verifyHashValidator = await EccUtil . verifyMessageSigned ( hashFromUserInfos , signatureOfUserInfos , validator ) ; if ( ! verifyHashValidator ) { let msgError = 'Validator Data Incorrect. Validator Publick Key Not Validated' ; logWrite ( ` ${ msgError } ` ) ; throw msgError ; } logWrite ( '[verifyValidator] Validator Data Ckecked' ) ; return verifyHashValidator ; }
@param {BeanDataBlock} blockData Data block with the set of process information.
@param { BeanDataBlock } blockData Data block with the set of process information .
// Informacoes do Validator // Informacoes publicas do Validator assinadas por ele //stop here; // Validator: OK ---------------------------------------