| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
SDJWT.Internal.Types
Description
Core data types for SD-JWT (Selective Disclosure for JSON Web Tokens).
This module defines all the data types used throughout the SD-JWT library, including hash algorithms, disclosures, SD-JWT structures, and error types. These types correspond to the structures defined in RFC 9901.
Synopsis
- data HashAlgorithm
- newtype Salt = Salt {
- unSalt :: ByteString
- newtype Digest = Digest {}
- data ObjectDisclosure = ObjectDisclosure {}
- data ArrayDisclosure = ArrayDisclosure {
- arraySalt :: Salt
- arrayValue :: Value
- data Disclosure
- newtype EncodedDisclosure = EncodedDisclosure {}
- data SDJWTPayload = SDJWTPayload {}
- newtype KeyBindingInfo = KeyBindingInfo {
- kbPublicKey :: Text
- data SDJWT = SDJWT {}
- data SDJWTPresentation = SDJWTPresentation {}
- data ProcessedSDJWTPayload = ProcessedSDJWTPayload {}
- data SDJWTError
Documentation
data HashAlgorithm Source #
Hash algorithm identifier for computing disclosure digests.
All three algorithms (SHA-256, SHA-384, SHA-512) must be supported. SHA-256 is the default when _sd_alg is not specified in the SD-JWT.
Instances
Salt value (cryptographically secure random).
Salts are used when creating disclosures to prevent brute-force attacks. RFC 9901 recommends 128 bits (16 bytes) of entropy.
Constructors
| Salt | |
Fields
| |
Instances
| Generic Salt Source # | |||||
Defined in SDJWT.Internal.Types Associated Types
| |||||
| Show Salt Source # | |||||
| Eq Salt Source # | |||||
| type Rep Salt Source # | |||||
Defined in SDJWT.Internal.Types type Rep Salt = D1 ('MetaData "Salt" "SDJWT.Internal.Types" "sd-jwt-0.1.0.0-Ha5SFOF1e9zHZXFdSA7HZR" 'True) (C1 ('MetaCons "Salt" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSalt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))) | |||||
Digest (base64url-encoded hash).
A digest is the base64url-encoded hash of a disclosure. Digests replace claim values in the SD-JWT payload to enable selective disclosure.
data ObjectDisclosure Source #
Disclosure for object properties: [salt, claim_name, claim_value]
Constructors
| ObjectDisclosure | |
Fields
| |
Instances
| Generic ObjectDisclosure Source # | |||||
Defined in SDJWT.Internal.Types Associated Types
Methods from :: ObjectDisclosure -> Rep ObjectDisclosure x # to :: Rep ObjectDisclosure x -> ObjectDisclosure # | |||||
| Show ObjectDisclosure Source # | |||||
Defined in SDJWT.Internal.Types Methods showsPrec :: Int -> ObjectDisclosure -> ShowS # show :: ObjectDisclosure -> String # showList :: [ObjectDisclosure] -> ShowS # | |||||
| Eq ObjectDisclosure Source # | |||||
Defined in SDJWT.Internal.Types Methods (==) :: ObjectDisclosure -> ObjectDisclosure -> Bool # (/=) :: ObjectDisclosure -> ObjectDisclosure -> Bool # | |||||
| type Rep ObjectDisclosure Source # | |||||
Defined in SDJWT.Internal.Types type Rep ObjectDisclosure = D1 ('MetaData "ObjectDisclosure" "SDJWT.Internal.Types" "sd-jwt-0.1.0.0-Ha5SFOF1e9zHZXFdSA7HZR" 'False) (C1 ('MetaCons "ObjectDisclosure" 'PrefixI 'True) (S1 ('MetaSel ('Just "disclosureSalt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Salt) :*: (S1 ('MetaSel ('Just "disclosureName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "disclosureValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)))) | |||||
data ArrayDisclosure Source #
Disclosure for array elements: [salt, claim_value]
Constructors
| ArrayDisclosure | |
Fields
| |
Instances
| Generic ArrayDisclosure Source # | |||||
Defined in SDJWT.Internal.Types Associated Types
Methods from :: ArrayDisclosure -> Rep ArrayDisclosure x # to :: Rep ArrayDisclosure x -> ArrayDisclosure # | |||||
| Show ArrayDisclosure Source # | |||||
Defined in SDJWT.Internal.Types Methods showsPrec :: Int -> ArrayDisclosure -> ShowS # show :: ArrayDisclosure -> String # showList :: [ArrayDisclosure] -> ShowS # | |||||
| Eq ArrayDisclosure Source # | |||||
Defined in SDJWT.Internal.Types Methods (==) :: ArrayDisclosure -> ArrayDisclosure -> Bool # (/=) :: ArrayDisclosure -> ArrayDisclosure -> Bool # | |||||
| type Rep ArrayDisclosure Source # | |||||
Defined in SDJWT.Internal.Types type Rep ArrayDisclosure = D1 ('MetaData "ArrayDisclosure" "SDJWT.Internal.Types" "sd-jwt-0.1.0.0-Ha5SFOF1e9zHZXFdSA7HZR" 'False) (C1 ('MetaCons "ArrayDisclosure" 'PrefixI 'True) (S1 ('MetaSel ('Just "arraySalt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Salt) :*: S1 ('MetaSel ('Just "arrayValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value))) | |||||
data Disclosure Source #
Unified disclosure type
Instances
| Generic Disclosure Source # | |||||
Defined in SDJWT.Internal.Types Associated Types
| |||||
| Show Disclosure Source # | |||||
Defined in SDJWT.Internal.Types Methods showsPrec :: Int -> Disclosure -> ShowS # show :: Disclosure -> String # showList :: [Disclosure] -> ShowS # | |||||
| Eq Disclosure Source # | |||||
Defined in SDJWT.Internal.Types | |||||
| type Rep Disclosure Source # | |||||
Defined in SDJWT.Internal.Types type Rep Disclosure = D1 ('MetaData "Disclosure" "SDJWT.Internal.Types" "sd-jwt-0.1.0.0-Ha5SFOF1e9zHZXFdSA7HZR" 'False) (C1 ('MetaCons "DisclosureObject" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ObjectDisclosure)) :+: C1 ('MetaCons "DisclosureArray" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ArrayDisclosure))) | |||||
newtype EncodedDisclosure Source #
Encoded disclosure (base64url string)
Constructors
| EncodedDisclosure | |
Fields | |
Instances
| Generic EncodedDisclosure Source # | |||||
Defined in SDJWT.Internal.Types Associated Types
Methods from :: EncodedDisclosure -> Rep EncodedDisclosure x # to :: Rep EncodedDisclosure x -> EncodedDisclosure # | |||||
| Show EncodedDisclosure Source # | |||||
Defined in SDJWT.Internal.Types Methods showsPrec :: Int -> EncodedDisclosure -> ShowS # show :: EncodedDisclosure -> String # showList :: [EncodedDisclosure] -> ShowS # | |||||
| Eq EncodedDisclosure Source # | |||||
Defined in SDJWT.Internal.Types Methods (==) :: EncodedDisclosure -> EncodedDisclosure -> Bool # (/=) :: EncodedDisclosure -> EncodedDisclosure -> Bool # | |||||
| type Rep EncodedDisclosure Source # | |||||
Defined in SDJWT.Internal.Types type Rep EncodedDisclosure = D1 ('MetaData "EncodedDisclosure" "SDJWT.Internal.Types" "sd-jwt-0.1.0.0-Ha5SFOF1e9zHZXFdSA7HZR" 'True) (C1 ('MetaCons "EncodedDisclosure" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEncodedDisclosure") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) | |||||
data SDJWTPayload Source #
SD-JWT payload structure Note: This is a simplified representation. The actual payload is a JSON object with _sd arrays and ... objects for arrays.
Constructors
| SDJWTPayload | |
Fields
| |
Instances
| Generic SDJWTPayload Source # | |||||
Defined in SDJWT.Internal.Types Associated Types
| |||||
| Show SDJWTPayload Source # | |||||
Defined in SDJWT.Internal.Types Methods showsPrec :: Int -> SDJWTPayload -> ShowS # show :: SDJWTPayload -> String # showList :: [SDJWTPayload] -> ShowS # | |||||
| Eq SDJWTPayload Source # | |||||
Defined in SDJWT.Internal.Types | |||||
| type Rep SDJWTPayload Source # | |||||
Defined in SDJWT.Internal.Types type Rep SDJWTPayload = D1 ('MetaData "SDJWTPayload" "SDJWT.Internal.Types" "sd-jwt-0.1.0.0-Ha5SFOF1e9zHZXFdSA7HZR" 'False) (C1 ('MetaCons "SDJWTPayload" 'PrefixI 'True) (S1 ('MetaSel ('Just "sdAlg") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe HashAlgorithm)) :*: S1 ('MetaSel ('Just "payloadValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value))) | |||||
newtype KeyBindingInfo Source #
Key Binding information from cnf claim
The public key is stored as a JWK JSON string (Text), which is compatible
with JWKLike. This allows users to work with JWKs
without requiring a direct dependency on the jose library.
Constructors
| KeyBindingInfo | |
Fields
| |
Instances
| Generic KeyBindingInfo Source # | |||||
Defined in SDJWT.Internal.Types Associated Types
Methods from :: KeyBindingInfo -> Rep KeyBindingInfo x # to :: Rep KeyBindingInfo x -> KeyBindingInfo # | |||||
| Show KeyBindingInfo Source # | |||||
Defined in SDJWT.Internal.Types Methods showsPrec :: Int -> KeyBindingInfo -> ShowS # show :: KeyBindingInfo -> String # showList :: [KeyBindingInfo] -> ShowS # | |||||
| Eq KeyBindingInfo Source # | |||||
Defined in SDJWT.Internal.Types Methods (==) :: KeyBindingInfo -> KeyBindingInfo -> Bool # (/=) :: KeyBindingInfo -> KeyBindingInfo -> Bool # | |||||
| type Rep KeyBindingInfo Source # | |||||
Defined in SDJWT.Internal.Types type Rep KeyBindingInfo = D1 ('MetaData "KeyBindingInfo" "SDJWT.Internal.Types" "sd-jwt-0.1.0.0-Ha5SFOF1e9zHZXFdSA7HZR" 'True) (C1 ('MetaCons "KeyBindingInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "kbPublicKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) | |||||
Complete SD-JWT structure (as issued)
Constructors
| SDJWT | |
Fields
| |
Instances
| Generic SDJWT Source # | |||||
Defined in SDJWT.Internal.Types Associated Types
| |||||
| Show SDJWT Source # | |||||
| Eq SDJWT Source # | |||||
| type Rep SDJWT Source # | |||||
Defined in SDJWT.Internal.Types type Rep SDJWT = D1 ('MetaData "SDJWT" "SDJWT.Internal.Types" "sd-jwt-0.1.0.0-Ha5SFOF1e9zHZXFdSA7HZR" 'False) (C1 ('MetaCons "SDJWT" 'PrefixI 'True) (S1 ('MetaSel ('Just "issuerSignedJWT") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "disclosures") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [EncodedDisclosure]))) | |||||
data SDJWTPresentation Source #
SD-JWT presentation (with selected disclosures)
Constructors
| SDJWTPresentation | |
Fields
| |
Instances
| Generic SDJWTPresentation Source # | |||||
Defined in SDJWT.Internal.Types Associated Types
Methods from :: SDJWTPresentation -> Rep SDJWTPresentation x # to :: Rep SDJWTPresentation x -> SDJWTPresentation # | |||||
| Show SDJWTPresentation Source # | |||||
Defined in SDJWT.Internal.Types Methods showsPrec :: Int -> SDJWTPresentation -> ShowS # show :: SDJWTPresentation -> String # showList :: [SDJWTPresentation] -> ShowS # | |||||
| Eq SDJWTPresentation Source # | |||||
Defined in SDJWT.Internal.Types Methods (==) :: SDJWTPresentation -> SDJWTPresentation -> Bool # (/=) :: SDJWTPresentation -> SDJWTPresentation -> Bool # | |||||
| type Rep SDJWTPresentation Source # | |||||
Defined in SDJWT.Internal.Types type Rep SDJWTPresentation = D1 ('MetaData "SDJWTPresentation" "SDJWT.Internal.Types" "sd-jwt-0.1.0.0-Ha5SFOF1e9zHZXFdSA7HZR" 'False) (C1 ('MetaCons "SDJWTPresentation" 'PrefixI 'True) (S1 ('MetaSel ('Just "presentationJWT") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "selectedDisclosures") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [EncodedDisclosure]) :*: S1 ('MetaSel ('Just "keyBindingJWT") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))))) | |||||
data ProcessedSDJWTPayload Source #
Processed SD-JWT payload (after verification)
Constructors
| ProcessedSDJWTPayload | |
Fields
| |
Instances
| Generic ProcessedSDJWTPayload Source # | |||||
Defined in SDJWT.Internal.Types Associated Types
Methods from :: ProcessedSDJWTPayload -> Rep ProcessedSDJWTPayload x # to :: Rep ProcessedSDJWTPayload x -> ProcessedSDJWTPayload # | |||||
| Show ProcessedSDJWTPayload Source # | |||||
Defined in SDJWT.Internal.Types Methods showsPrec :: Int -> ProcessedSDJWTPayload -> ShowS # show :: ProcessedSDJWTPayload -> String # showList :: [ProcessedSDJWTPayload] -> ShowS # | |||||
| Eq ProcessedSDJWTPayload Source # | |||||
Defined in SDJWT.Internal.Types Methods (==) :: ProcessedSDJWTPayload -> ProcessedSDJWTPayload -> Bool # (/=) :: ProcessedSDJWTPayload -> ProcessedSDJWTPayload -> Bool # | |||||
| type Rep ProcessedSDJWTPayload Source # | |||||
Defined in SDJWT.Internal.Types type Rep ProcessedSDJWTPayload = D1 ('MetaData "ProcessedSDJWTPayload" "SDJWT.Internal.Types" "sd-jwt-0.1.0.0-Ha5SFOF1e9zHZXFdSA7HZR" 'False) (C1 ('MetaCons "ProcessedSDJWTPayload" 'PrefixI 'True) (S1 ('MetaSel ('Just "processedClaims") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Object) :*: S1 ('MetaSel ('Just "keyBindingInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe KeyBindingInfo)))) | |||||
data SDJWTError Source #
SD-JWT errors
Constructors
| InvalidDisclosureFormat Text | |
| InvalidDigest Text | |
| MissingDisclosure Text | |
| DuplicateDisclosure Text | |
| InvalidSignature Text | |
| InvalidKeyBinding Text | |
| InvalidHashAlgorithm Text | |
| InvalidClaimName Text | |
| SaltGenerationError Text | |
| JSONParseError Text | |
| SerializationError Text | |
| VerificationError Text |
Instances
| Show SDJWTError Source # | |
Defined in SDJWT.Internal.Types Methods showsPrec :: Int -> SDJWTError -> ShowS # show :: SDJWTError -> String # showList :: [SDJWTError] -> ShowS # | |
| Eq SDJWTError Source # | |
Defined in SDJWT.Internal.Types | |