Skip to main content

decode_disclosure

Function decode_disclosure 

pub fn decode_disclosure(disclosure_b64: &str) -> Result<Disclosure, ViError>
Expand description

Decode a disclosure into its typed form.

Stricter than the reference, which returns whatever JSON the disclosure happens to hold: anything that is not a 2- or 3-element array with a string salt is refused here rather than reaching a caller obliged to re-check it.

The bytes are parsed with the same duplicate-refusing reader the signed header and payload use. A disclosure is bound by a digest the issuer signed, and resolution merges its value into the claim set, so a repeated member inside one is a repeated claim name in the payload a verifier acts on. Reading it with a parser that silently keeps one of the two would leave the ambiguity undetectable by the time anything could act on it.