asn1lib 0.5.5

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 85

An ASN.1 Parser for Dart.

Encodes & decodes ASN1 using BER encoding.

There is just enough implementation here to get an LDAP client library working.

Sample

 var s = new ASN1Sequence();
s.add( new ASN1Integer(23));
s.add( new ASN1OctetString('This is a test'));
s.add( new ASN1Boolean(true));

// GET the BER Stream
var bytes = s.encodedBytes;

// decode
var p = new ASN1Parser(bytes);
var s2 = p.nextObject();
// s2 is a sequence...

Changes #

Remove obsolete crypto dependency in tests.

Added PrintableString and UTC Time elements

Changes to support RSA Private key : PEM file

Add import "package:bignum/bignum.dart"; in asn1lib.dart

Add ASN1ObjectIdentifier class

Add OBJECT_IDENTIFIER in asn1constants.dart

Modify ASN1Parser._doPrimitive to take OBJECT_IDENTIFIER and NULL_TYPE into account

Modify ASN1Null add contructor ASN1Null.fromBytes

Modify ASN1Integer to support BigInteger

Modify asn1element_test.dart to test BigInteger case, and rsa private key test

Add test/resource folder to store rsa key for testing

Changes to support RSA public key : PEM file

Add ASN1BitString class : not sure how to handle bitstring when unused bits is not zero

Add BIT_STRING_TYPE in asn1constants.dart

Modify ASN1Parser._doPrimitive to take BIT_STRING_TYPE into account

Modify asn1element_test.dart to test rsa public key

Changelog #

0.5.5 #

Merged #27

Updates to ASN1ObjectIdentifier to:

  • allow creation from dotted number lists
  • allow creation from dotted number strings
  • allow names to be registered, for shorthands
  • allow bulk name registration
  • commonly used names (obviously, what this is could be expanded)

0.5.4 #

Fixed #26

0.5.1 #

Add AS1Integer.fromInt factory method

0.5.0 #

  • Convert use of BigInteger to dart SDK BigInt

0.4.3 #

  • Updates for dart 2

0.4.2 #

  • Added contentBytes() getter
  • Removed Int64List dependency and use bignum's BigInteger instead

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  asn1lib: ^0.5.5

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:asn1lib/asn1lib.dart';
  
Version Uploaded Documentation Archive
0.5.8 Mar 28, 2019 Go to the documentation of asn1lib 0.5.8 Download asn1lib 0.5.8 archive
0.5.7 Mar 15, 2019 Go to the documentation of asn1lib 0.5.7 Download asn1lib 0.5.7 archive
0.5.6 Mar 15, 2019 Go to the documentation of asn1lib 0.5.6 Download asn1lib 0.5.6 archive
0.5.5 Mar 15, 2019 Go to the documentation of asn1lib 0.5.5 Download asn1lib 0.5.5 archive
0.5.4 Mar 14, 2019 Go to the documentation of asn1lib 0.5.4 Download asn1lib 0.5.4 archive
0.5.3 Oct 6, 2018 Go to the documentation of asn1lib 0.5.3 Download asn1lib 0.5.3 archive
0.5.2 Jul 28, 2018 Go to the documentation of asn1lib 0.5.2 Download asn1lib 0.5.2 archive
0.5.1 Jul 9, 2018 Go to the documentation of asn1lib 0.5.1 Download asn1lib 0.5.1 archive
0.5.0 Jun 15, 2018 Go to the documentation of asn1lib 0.5.0 Download asn1lib 0.5.0 archive
0.4.3 Jun 4, 2018 Go to the documentation of asn1lib 0.4.3 Download asn1lib 0.4.3 archive

All 21 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
85
Health:
Code health derived from static analysis. [more]
82
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
85
Learn more about scoring.

We analyzed this package on May 8, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.0
  • pana: 0.12.15

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:asn1lib/asn1lib.dart.

Health suggestions

Fix lib/asn1object.dart. (-5.84 points)

Analysis of lib/asn1object.dart reported 12 hints, including:

line 4 col 1: Prefer using /// for doc comments.

line 18 col 3: Prefer using /// for doc comments.

line 47 col 22: Use = to separate a named parameter from its default value.

line 49 col 3: Prefer using /// for doc comments.

line 62 col 3: Prefer using /// for doc comments.

Fix lib/asn1integer.dart. (-2.48 points)

Analysis of lib/asn1integer.dart reported 5 hints:

line 2 col 1: Prefer using /// for doc comments.

line 13 col 35: Use = to separate a named parameter from its default value.

line 15 col 33: Use = to separate a named parameter from its default value.

line 47 col 3: Prefer using /// for doc comments.

line 66 col 3: Prefer using /// for doc comments.

Fix lib/asn1objectidentifier.dart. (-1.99 points)

Analysis of lib/asn1objectidentifier.dart reported 4 hints:

line 8 col 36: Use = to separate a named parameter from its default value.

line 20 col 67: Use = to separate a named parameter from its default value.

line 23 col 71: Use = to separate a named parameter from its default value.

line 55 col 56: Use = to separate a named parameter from its default value.

Fix additional 15 files with analysis or formatting issues. (-8.98 points)

Additional issues in the following files:

  • lib/asn1length.dart (3 hints)
  • lib/asn1set.dart (3 hints)
  • lib/asn1bitstring.dart (2 hints)
  • lib/asn1enumerated.dart (2 hints)
  • lib/asn1parser.dart (2 hints)
  • lib/asn1sequence.dart (2 hints)
  • lib/asn1boolean.dart (1 hint)
  • lib/asn1octetstring.dart (1 hint)
  • lib/asn1printablestring.dart (1 hint)
  • lib/asn1utctime.dart (1 hint)
  • lib/asn1constants.dart (Run dartfmt to format lib/asn1constants.dart.)
  • lib/asn1exception.dart (Run dartfmt to format lib/asn1exception.dart.)
  • lib/asn1lib.dart (Run dartfmt to format lib/asn1lib.dart.)
  • lib/asn1null.dart (Run dartfmt to format lib/asn1null.dart.)
  • lib/asn1util.dart (Run dartfmt to format lib/asn1util.dart.)

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and asn1lib.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.69.0 <3.0.0
Dev dependencies
convert ^2.0.1
test >=1.5.3