As a result, while running a program that uses the crypton package after running dart pub upgrade, everything still runs just fine but the Dart VM now prints out the following warnings when it starts up:
../../../../.pub-cache/hosted/pub.dev/crypton-2.1.0/lib/src/rsa/private_key.dart:23:40: Warning: Operand of null-aware operation '!' has type 'Uint8List' which excludes null.
- 'Uint8List' is from 'dart:typed_data'.
asn1Parser = ASN1Parser(privateKey.contentBytes()!);
^
../../../../.pub-cache/hosted/pub.dev/crypton-2.1.0/lib/src/rsa/private_key.dart:32:17: Warning: Operand of null-aware operation '!' has type 'BigInt' which excludes null.
- 'BigInt' is from 'dart:core'.
modulus.valueAsBigInteger!,
^
../../../../.pub-cache/hosted/pub.dev/crypton-2.1.0/lib/src/rsa/private_key.dart:33:25: Warning: Operand of null-aware operation '!' has type 'BigInt' which excludes null.
- 'BigInt' is from 'dart:core'.
privateExponent.valueAsBigInteger!,
^
../../../../.pub-cache/hosted/pub.dev/crypton-2.1.0/lib/src/rsa/public_key.dart:23:56: Warning: Operand of null-aware operation '!' has type 'Uint8List' which excludes null.
- 'Uint8List' is from 'dart:typed_data'.
final publicKeyAsn = ASN1Parser(publicKeyBitString.contentBytes()!);
^
../../../../.pub-cache/hosted/pub.dev/crypton-2.1.0/lib/src/rsa/public_key.dart:29:17: Warning: Operand of null-aware operation '!' has type 'BigInt' which excludes null.
- 'BigInt' is from 'dart:core'.
modulus.valueAsBigInteger!, exponent.valueAsBigInteger!);
^
../../../../.pub-cache/hosted/pub.dev/crypton-2.1.0/lib/src/rsa/public_key.dart:29:46: Warning: Operand of null-aware operation '!' has type 'BigInt' which excludes null.
- 'BigInt' is from 'dart:core'.
modulus.valueAsBigInteger!, exponent.valueAsBigInteger!);
^
I'm happy to make a fix and send a pull request if you wish
The latest version of asn1lib requires dart ^3.0.0 and makes a number of changes re nullability in its API (commit)
As a result, while running a program that uses the
crypton
package after runningdart pub upgrade
, everything still runs just fine but the Dart VM now prints out the following warnings when it starts up:I'm happy to make a fix and send a pull request if you wish