jwk 0.2.3 copy "jwk: ^0.2.3" to clipboard
jwk: ^0.2.3 copied to clipboard

JWK (JSON Web Key) encoding and decoding (for package:cryptography).

Pub Package Github Actions CI

Overview #

JWK (JSON Web Key) encoding and decoding. Designed to be used with package:cryptography.

Licensed under the Apache License 2.0.

Getting started #

In pubspec.yaml

dependencies:
  cryptography: ^2.7.0
  jwk: ^0.2.3

Examples #

Encoding KeyPair #

import 'package:cryptography/cryptography.dart';
import 'package:jwk/jwk.dart';

Future<void> main() async {
  final keyPair = await RsaPss().newKeyPair();
  final jwk = Jwk.fromKeyPair(keyPair);
  final json = jwk.toJson();
}

Decoding SecretKey #

import 'package:jwk/jwk.dart';

void main() {
  final jwk = Jwk.fromJson({
    'kty': 'OCT',
    'alg': 'A128KW',
    'k': 'GawgguFyGrWKav7AX4VKUg',
  });
  final secretKey = jwk.toSecretKey();
}
5
likes
150
pub points
67%
popularity

Publisher

verified publisherdint.dev

JWK (JSON Web Key) encoding and decoding (for package:cryptography).

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

collection, cryptography

More

Packages that depend on jwk