Skip to content

Commit 1b606a1

Browse files
Merge pull request #41 from gkc/gkc-fix-dart-3-warnings
Update `asn1lib` dependency to ^1.5.0 and fix the resulting lint warnings
2 parents e014ad8 + 29756b4 commit 1b606a1

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2.2.0
2+
- Update `asn1lib` dependency to ^1.5.0 and fix the resulting lint warnings
3+
14
## 2.1.0
25
- Add `KeypairFactory`, `RSAKeypairFactory` and `ECKeypairFactory`
36
- Update dependencies

lib/src/rsa/private_key.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class RSAPrivateKey implements PrivateKey {
2020
final topLevelSeq = asn1Parser.nextObject() as ASN1Sequence;
2121
final privateKey = topLevelSeq.elements[2];
2222

23-
asn1Parser = ASN1Parser(privateKey.contentBytes()!);
23+
asn1Parser = ASN1Parser(privateKey.contentBytes());
2424
final pkSeq = asn1Parser.nextObject() as ASN1Sequence;
2525

2626
final modulus = pkSeq.elements[1] as ASN1Integer;
@@ -29,8 +29,8 @@ class RSAPrivateKey implements PrivateKey {
2929
final q = pkSeq.elements[5] as ASN1Integer;
3030

3131
_privateKey = pointy.RSAPrivateKey(
32-
modulus.valueAsBigInteger!,
33-
privateExponent.valueAsBigInteger!,
32+
modulus.valueAsBigInteger,
33+
privateExponent.valueAsBigInteger,
3434
p.valueAsBigInteger,
3535
q.valueAsBigInteger);
3636
}

lib/src/rsa/public_key.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ class RSAPublicKey implements PublicKey {
2020
final topLevelSeq = asn1Parser.nextObject() as ASN1Sequence;
2121
final publicKeyBitString = topLevelSeq.elements[1];
2222

23-
final publicKeyAsn = ASN1Parser(publicKeyBitString.contentBytes()!);
23+
final publicKeyAsn = ASN1Parser(publicKeyBitString.contentBytes());
2424
final publicKeySeq = publicKeyAsn.nextObject() as ASN1Sequence;
2525
final modulus = publicKeySeq.elements[0] as ASN1Integer;
2626
final exponent = publicKeySeq.elements[1] as ASN1Integer;
2727

2828
_publicKey = pointy.RSAPublicKey(
29-
modulus.valueAsBigInteger!, exponent.valueAsBigInteger!);
29+
modulus.valueAsBigInteger, exponent.valueAsBigInteger);
3030
}
3131

3232
/// Create an [RSAPublicKey] from the given PEM-String.

pubspec.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
name: crypton
22
description: A simple Dart library for asymmetric encryption and digital signatures
3-
version: 2.1.0
3+
version: 2.2.0
44
homepage: https://github.com/konstantinullrich
55
repository: https://github.com/konstantinullrich/crypton
66
issue_tracker: https://github.com/konstantinullrich/crypton/issues
77

88
environment:
9-
sdk: '>=2.14.0 <3.0.0'
9+
sdk: '>=2.14.0 <4.0.0'
1010

1111
dependencies:
1212
pointycastle: ^3.6.2
13-
asn1lib: ^1.2.2
13+
asn1lib: ^1.5.0
1414

1515
dev_dependencies:
16-
lints: ^1.0.1
17-
test: ^1.21.4
16+
lints: ^2.1.1
17+
test: ^1.24.4

0 commit comments

Comments
 (0)