Skip to content
pubscout

selective_disclosure_jwt

1.1.1, released a year ago by affinidi.com

Dart SDK for working with Selective Disclosure JSON Web Tokens (SD-JWT)

WASM-ready
$ flutter pub add selective_disclosure_jwt
Source repository

What it does

Implements the IETF SD-JWT specification allowing issuers to create JWTs with selectively disclosable claims, holders to present specific claims, and verifiers to validate them.

AI-written summary of version 1.1.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to implement privacy-preserving data sharing using Selective Disclosure JSON Web Tokens.
  • Your application acts as an Issuer, Holder, or Verifier within an SD-JWT workflow.

Skip it when

  • You only require standard JWT encoding and decoding without selective disclosure features.

Strengths

  • Supports multiple signing algorithms including ES256, ES256K, RS256, HS256, and EdDSA.
  • Provides built-in key binding to prevent unauthorized presentations.

Weaknesses

  • Niche standard that may require understanding complex IETF specifications.
  • Custom signers, hashers, and verifiers must be written manually if you use uncommon cryptographic algorithms.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
7
import 'package:selective_disclosure_jwt/selective_disclosure_jwt.dart';

void main() async {
  final issuerPrivateKey = SdPrivateKey('KEY', SdJwtSignAlgorithm.es256k);
  final handler = SdJwtHandlerV1();
  final claims = {'given_name': 'Alice', 'family_name': 'Smith'};
  final disclosureFrame = {'_sd': ['given_name']};

  final sdJwt = await handler.sign(
    claims: claims,
    disclosureFrame: disclosureFrame,
    signer: SDKeySigner(issuerPrivateKey),
  );
  print(sdJwt.serialized);
}

Alternatives

Packages that do the same job and could replace selective_disclosure_jwt.

Works with

Packages commonly used together with selective_disclosure_jwt: ones it builds on, ones built on it, and its own family.