extract_proof: Extract the proof from an xml proof or pdf certificate

View source: R/extract_proof.R

extract_proofR Documentation

Extract the proof from an xml proof or pdf certificate

Description

If the v verification fails, the function aborts and raises an error.

Usage

extract_proof(x, verify = TRUE, verbose = FALSE)

Arguments

x

filename or URL pointing either to the xml proof or the pdf certificate issued from OriginStamp.

verify

if FALSE, read the root hash from the xml file. If TRUE, verify the root hash using the proof.

verbose

if TRUE, details on the verification will be printed which can help to see where the proof is wrong.

Value

the root hash

Examples

extract_proof(system.file("certificate.Bitcoin.pdf", package = "ROriginStamp"))
extract_proof(system.file("proof.Bitcoin.xml", package = "ROriginStamp"))
extract_proof(system.file("proof.Bitcoin.xml", package = "ROriginStamp"), verify = FALSE)
######
## These will produce errors when executed
  # extract_proof(system.file("proof.faulty.xml", package = "ROriginStamp"))
  # extract_proof(system.file("proof.faulty.xml", package = "ROriginStamp"), verbose = TRUE)
######


rkrug/ROriginStamp documentation built on Aug. 16, 2022, 5:45 p.m.