This commit is contained in:
Jonas Roussel
2021-05-21 21:39:34 +02:00
parent 2fcea79c95
commit 148563837c
4 changed files with 14 additions and 12 deletions

3
.gitignore vendored
View File

@ -9,6 +9,9 @@ pubspec.lock
# Conventional directory for build outputs
build/
# VSCode
.vscode/
# Directory created by dartdoc
doc/api/

View File

@ -1,3 +1,7 @@
## 2.1.1
- Fixing `_pkcs8ECPublicKey` to work with pointycastle 3.0.1
## 2.1.0
- When an undefined error occur `JWTUndefinedError` is thrown containing the original error in `error` property (https://github.com/jonasroussel/jsonwebtoken/issues/9)

View File

@ -1,8 +1,8 @@
import 'dart:typed_data';
import 'dart:convert';
import 'package:pointycastle/pointycastle.dart' hide ECPoint, ECCurve;
import 'package:pointycastle/ecc/ecc_fp.dart';
import 'package:pointycastle/pointycastle.dart';
import 'package:pointycastle/ecc/ecc_fp.dart' as ecc_fp;
import 'utils.dart';
@ -215,17 +215,12 @@ ECPublicKey? _pkcs8ECPublicKey(Uint8List bytes) {
final bigX = decodeBigIntWithSign(1, x);
final bigY = decodeBigIntWithSign(1, y);
final params = ECDomainParameters(curve);
final ecCurve = ECCurve(
null,
params.curve.a?.toBigInteger(),
params.curve.b?.toBigInteger(),
);
return ECPublicKey(
ECPoint(
ecCurve,
ecCurve.fromBigInteger(bigX),
ecCurve.fromBigInteger(bigY),
ecc_fp.ECPoint(
params.curve as ecc_fp.ECCurve,
params.curve.fromBigInteger(bigX) as ecc_fp.ECFieldElement?,
params.curve.fromBigInteger(bigY) as ecc_fp.ECFieldElement?,
compressed,
),
params,

View File

@ -1,6 +1,6 @@
name: dart_jsonwebtoken
description: A dart implementation of the famous javascript library 'jsonwebtoken' (JWT).
version: 2.1.0
version: 2.1.1
repository: https://github.com/jonasroussel/jsonwebtoken
homepage: https://github.com/jonasroussel/jsonwebtoken#readme