Skip to main content

parse_sd_jwt

Function parse_sd_jwt 

pub fn parse_sd_jwt(
    serialized: &str,
) -> Result<(&str, Vec<&str>, Option<&str>), ViError>
Expand description

Parse a serialized SD-JWT into (issuer_jwt, disclosures, optional_kb_jwt).

The two forms are distinguished by the final ~: a presentation without key binding keeps it, and one with key binding ends in the key-binding JWT. That distinction is the only thing separating issuer~disclosure from issuer~disclosure~, and reading the first as the second silently drops the last disclosure while inventing a key binding. So the final component is required to look like a JWT before it is treated as one.

Structure only. Nothing here checks a key-binding JWT’s audience, nonce, sd_hash or signature; those are chain-verification concerns above this layer.