mirror of
https://github.com/jonasroussel/dart_jsonwebtoken.git
synced 2025-08-24 04:52:13 +08:00
v2.7.1
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
## 2.7.1
|
||||||
|
|
||||||
|
- Migrating from `pedantic` to `lints`
|
||||||
|
|
||||||
## 2.7.0
|
## 2.7.0
|
||||||
|
|
||||||
- `parsing.dart` has been replaced by more accurate CryptoUtils functions `https://github.com/Ephenodrom/Dart-Basic-Utils`
|
- `parsing.dart` has been replaced by more accurate CryptoUtils functions `https://github.com/Ephenodrom/Dart-Basic-Utils`
|
||||||
|
@ -1 +1 @@
|
|||||||
include: package:pedantic/analysis_options.yaml
|
include: package:lints/core.yaml
|
||||||
|
@ -511,7 +511,7 @@ class CryptoUtils {
|
|||||||
.map((line) => line.trim())
|
.map((line) => line.trim())
|
||||||
.where((line) => line.isNotEmpty)
|
.where((line) => line.isNotEmpty)
|
||||||
.toList();
|
.toList();
|
||||||
var base64;
|
String base64;
|
||||||
if (checkHeader) {
|
if (checkHeader) {
|
||||||
if (lines.length < 2 ||
|
if (lines.length < 2 ||
|
||||||
!lines.first.startsWith('-----BEGIN') ||
|
!lines.first.startsWith('-----BEGIN') ||
|
||||||
@ -541,7 +541,7 @@ class CryptoUtils {
|
|||||||
static RSAPublicKey rsaPublicKeyFromDERBytes(Uint8List bytes) {
|
static RSAPublicKey rsaPublicKeyFromDERBytes(Uint8List bytes) {
|
||||||
var asn1Parser = ASN1Parser(bytes);
|
var asn1Parser = ASN1Parser(bytes);
|
||||||
var topLevelSeq = asn1Parser.nextObject() as ASN1Sequence;
|
var topLevelSeq = asn1Parser.nextObject() as ASN1Sequence;
|
||||||
var publicKeySeq;
|
ASN1Sequence publicKeySeq;
|
||||||
if (topLevelSeq.elements![1].runtimeType == ASN1BitString) {
|
if (topLevelSeq.elements![1].runtimeType == ASN1BitString) {
|
||||||
var publicKeyBitString = topLevelSeq.elements![1] as ASN1BitString;
|
var publicKeyBitString = topLevelSeq.elements![1] as ASN1BitString;
|
||||||
|
|
||||||
@ -696,8 +696,8 @@ class CryptoUtils {
|
|||||||
{bool pkcs8 = false}) {
|
{bool pkcs8 = false}) {
|
||||||
var asn1Parser = ASN1Parser(bytes);
|
var asn1Parser = ASN1Parser(bytes);
|
||||||
var topLevelSeq = asn1Parser.nextObject() as ASN1Sequence;
|
var topLevelSeq = asn1Parser.nextObject() as ASN1Sequence;
|
||||||
var curveName;
|
String? curveName;
|
||||||
var x;
|
Uint8List x;
|
||||||
if (pkcs8) {
|
if (pkcs8) {
|
||||||
// Parse the PKCS8 format
|
// Parse the PKCS8 format
|
||||||
var innerSeq = topLevelSeq.elements!.elementAt(1) as ASN1Sequence;
|
var innerSeq = topLevelSeq.elements!.elementAt(1) as ASN1Sequence;
|
||||||
@ -735,7 +735,7 @@ class CryptoUtils {
|
|||||||
x = privateKeyAsOctetString.valueBytes!;
|
x = privateKeyAsOctetString.valueBytes!;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ECPrivateKey(osp2i(x), ECDomainParameters(curveName));
|
return ECPrivateKey(osp2i(x), ECDomainParameters(curveName!));
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -751,7 +751,7 @@ class CryptoUtils {
|
|||||||
var algorithmIdentifierSequence = topLevelSeq.elements![0] as ASN1Sequence;
|
var algorithmIdentifierSequence = topLevelSeq.elements![0] as ASN1Sequence;
|
||||||
var curveNameOi = algorithmIdentifierSequence.elements!.elementAt(1)
|
var curveNameOi = algorithmIdentifierSequence.elements!.elementAt(1)
|
||||||
as ASN1ObjectIdentifier;
|
as ASN1ObjectIdentifier;
|
||||||
var curveName;
|
String? curveName;
|
||||||
var data = ObjectIdentifiers.getIdentifierByIdentifier(
|
var data = ObjectIdentifiers.getIdentifierByIdentifier(
|
||||||
curveNameOi.objectIdentifierAsString);
|
curveNameOi.objectIdentifierAsString);
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
@ -772,7 +772,7 @@ class CryptoUtils {
|
|||||||
}
|
}
|
||||||
var x = pubBytes.sublist(1, (pubBytes.length / 2).round());
|
var x = pubBytes.sublist(1, (pubBytes.length / 2).round());
|
||||||
var y = pubBytes.sublist(1 + x.length, pubBytes.length);
|
var y = pubBytes.sublist(1 + x.length, pubBytes.length);
|
||||||
var params = ECDomainParameters(curveName);
|
var params = ECDomainParameters(curveName!);
|
||||||
var bigX = decodeBigIntWithSign(1, x);
|
var bigX = decodeBigIntWithSign(1, x);
|
||||||
var bigY = decodeBigIntWithSign(1, y);
|
var bigY = decodeBigIntWithSign(1, y);
|
||||||
var pubKey = ECPublicKey(
|
var pubKey = ECPublicKey(
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: dart_jsonwebtoken
|
name: dart_jsonwebtoken
|
||||||
description: A dart implementation of the famous javascript library 'jsonwebtoken' (JWT).
|
description: A dart implementation of the famous javascript library 'jsonwebtoken' (JWT).
|
||||||
version: 2.7.0
|
version: 2.7.1
|
||||||
repository: https://github.com/jonasroussel/dart_jsonwebtoken
|
repository: https://github.com/jonasroussel/dart_jsonwebtoken
|
||||||
homepage: https://github.com/jonasroussel/dart_jsonwebtoken#readme
|
homepage: https://github.com/jonasroussel/dart_jsonwebtoken#readme
|
||||||
|
|
||||||
@ -21,4 +21,4 @@ dependencies:
|
|||||||
ed25519_edwards: ^0.3.1
|
ed25519_edwards: ^0.3.1
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
pedantic: ^1.11.0
|
lints: ^2.0.1
|
||||||
|
Reference in New Issue
Block a user