application/docRevoke.js
/**
 * Adds revoker data to the block.
 * @param {BeanUser} revoker User as revoker role.  
 * @param {BeanDataBlock} blockData Data block with the set of process information. 
 */
Adds revoker data to the block.
@param {BeanUser} revoker User as revoker role.
@param {BeanDataBlock} blockData Data block with the set of process information.
Adds revoker data to the block . @param { BeanUser } revoker User as revoker role . @param { BeanDataBlock } blockData Data block with the set of process information .
async function processToAddRevoker(revoker, blockData) {
    revoker = await BeanUser.generateSignatureOfUserInfos(revoker);
    var dateTimeRevoke = new Date();
    blockData.setDateTimeRevoke(dateTimeRevoke.toISOString());
	let dateTimeHashFactory = createHash();
    let dateTimeRevokeHash = dateTimeHashFactory.update(blockData.dateTimeRevoke).digest(hex);
    var dateTimeSignedByRevoker = await EccUtil.signMessage(revoker, dateTimeRevokeHash);
    blockData.setDateTimeSignedByRevoker(dateTimeSignedByRevoker);
    blockData.setStatus(BeanDataBlock.getBlockState().REVOKED);
	var revokerPersona = BeanUser.createBeanUser(revoker);
    revokerPersona.clearSecurityData();
	blockData.setRevoker(revokerPersona);
    return blockData;        
}
async function processToAddRevoker ( revoker , blockData ) { revoker = await BeanUser . generateSignatureOfUserInfos ( revoker ) ; var dateTimeRevoke = new Date ( ) ; blockData . setDateTimeRevoke ( dateTimeRevoke . toISOString ( ) ) ; let dateTimeHashFactory = createHash ( ) ; let dateTimeRevokeHash = dateTimeHashFactory . update ( blockData . dateTimeRevoke ) . digest ( hex ) ; var dateTimeSignedByRevoker = await EccUtil . signMessage ( revoker , dateTimeRevokeHash ) ; blockData . setDateTimeSignedByRevoker ( dateTimeSignedByRevoker ) ; blockData . setStatus ( BeanDataBlock . getBlockState ( ) . REVOKED ) ; var revokerPersona = BeanUser . createBeanUser ( revoker ) ; revokerPersona . clearSecurityData ( ) ; blockData . setRevoker ( revokerPersona ) ; return blockData ; }
Adds revoker data to the block.
Adds revoker data to the block .
// Get the system date-time to use in the data block /*
     * The date-time must be signed by the Revoker to avoid tampering
     */ // Validation date-time signed // Set status to VALIDATED // Prevents the private dataset from being inside the user's data