envelope
NUC envelope.
- class DecodedNucToken(raw_header: str, raw_payload: str, signature: bytes, token: NucToken)[source]
Bases:
objectA decoded NUC token.
- static parse(data: str) DecodedNucToken[source]
Parse a token from its serialized JWT form.
Note that this only parses the token and ensures it is structurally correct. This does not perform any form of signature validation.
Note
Users should use
NucTokenEnvelopeto parse tokens.
- __eq__(other)
Return self==value.
- __repr__()
Return repr(self).
- class NucTokenEnvelope(token: DecodedNucToken, proofs: List[DecodedNucToken])[source]
Bases:
objectA NUC token envelope, containing a parsed token along with all its proofs
- static parse(data: str) NucTokenEnvelope[source]
Parse a NUC token envelope from its serialized JWT form.
Note that this only parses the envelope and ensures it is structurally correct. This does not perform any form of signature validation.
Example
from nuc.envelope import NucTokenEnvelope raw_token = "....." token = NucTokenEnvelope.parse(raw_token)
- exception MalformedNucJwtException[source]
Bases:
ExceptionAn exception thrown when a malformed NUC JWT is parsed.