import { PresentationDefinitionModel } from '..'; /** * Enum for define the token type */ export declare enum TokenType { /** * Token is self issued */ selfIssued = "selfIssued", /** * Token is id token */ idToken = "idToken", /** * Token is SIOP token issuance request */ siopIssuance = "siopIssuance", /** * Token is SIOP token */ siop = "siop", /** * Token is SIOP token presentation request with attestation presentation protocol */ siopPresentationAttestation = "siopPresentationAttestation", /** * Token is SIOP token presentation request with presentation exchange protocol */ siopPresentationExchange = "siopPresentationExchange", /** * Token is verifiable presentation */ verifiablePresentationJwt = "verifiablePresentationJwt", /** * Token is verifiable credential */ verifiableCredential = "verifiableCredential", /** * Token is verifiable credential */ verifiablePresentationStatus = "verifiablePresentationStatus" } /** * Model for the claim token in compact format */ export default class ClaimToken { private _id; private _rawToken; private _type; private _decodedToken; private _tokenHeader; /** * Token type */ get type(): TokenType; /** * Token configuration endpoint */ get id(): string; /** * Gets the raw token */ get rawToken(): string | object; /** * Sets the raw token */ set rawToken(value: string | object); /** * Gets the token header */ get tokenHeader(): { [key: string]: any; }; /** * Gets the decoded token */ get decodedToken(): { [key: string]: any; }; /** * Create a new instance of * @param typeName Name of the token in _claimNames * @param token The raw token * @param id The id of the token (configuration endpoint for id tokens) */ constructor(typeName: string, token: string | object, id?: string); /** * Factory class to create a ClaimToken containing the token type, raw token and decoded payload * @param token to check for type */ static create(token: string | object, id?: string): ClaimToken; /** * Attestations contain the tokens and VCs in the input. * This algorithm will convert the attestations to a ClaimToken * @param attestations All presented claims */ static getClaimTokensFromAttestations(attestations: { [key: string]: string; }): { [key: string]: ClaimToken; }; /** * Attestations contain the tokens and VCs in the input. * This algorithm will convert the attestations to a ClaimToken * @param payload The presentaiton exchange payload */ static getClaimTokensFromPresentationExchange(payload: PresentationDefinitionModel): { [key: string]: ClaimToken; }; /** * Decode the token * @param type Claim type * @param values Claim value */ private decode; /** * Get the token object from the self issued token * @param token The token to parse * @returns The payload object */ private static getTokenPayload; /** * Get the token object from the self issued token * @param token The token to parse * @returns The payload object */ private static tokenSignature; }