sha256 method

  1. @override
Future<Uint8List> sha256(
  1. Uint8List data
)

Computes a SHA-256 digest of data. Used for the JWK Thumbprint (jkt) and the access token hash (ath).

Implementation

@override
Future<Uint8List> sha256(Uint8List data) async {
  try {
    final digest = await wc.Hash.sha256.digestBytes(data);
    return Uint8List.fromList(digest);
  } catch (_) {
    throw const DpopCryptoException('SHA-256 digest computation failed.');
  }
}