asn1lib 0.4.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 65

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.4.2

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

1. Depend on it

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


dependencies:
  asn1lib: "^0.4.2"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages 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.4.2 Jul 4, 2016 Go to the documentation of asn1lib 0.4.2 Download asn1lib 0.4.2 archive
0.4.1 Mar 10, 2015 Go to the documentation of asn1lib 0.4.1 Download asn1lib 0.4.1 archive
0.4.0 Mar 3, 2015 Go to the documentation of asn1lib 0.4.0 Download asn1lib 0.4.0 archive
0.3.5 Mar 3, 2015 Go to the documentation of asn1lib 0.3.5 Download asn1lib 0.3.5 archive
0.3.4 Feb 28, 2015 Go to the documentation of asn1lib 0.3.4 Download asn1lib 0.3.4 archive
0.3.3 Nov 9, 2014 Go to the documentation of asn1lib 0.3.3 Download asn1lib 0.3.3 archive
0.3.2 Jun 9, 2014 Go to the documentation of asn1lib 0.3.2 Download asn1lib 0.3.2 archive
0.3.0 Mar 28, 2014 Go to the documentation of asn1lib 0.3.0 Download asn1lib 0.3.0 archive
0.2.0 Mar 14, 2014 Go to the documentation of asn1lib 0.2.0 Download asn1lib 0.2.0 archive
0.1.1 Nov 9, 2013 Go to the documentation of asn1lib 0.1.1 Download asn1lib 0.1.1 archive

All 11 versions...

Analysis

We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

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

Platforms

Detected platforms: Flutter, web, other

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

Suggestions

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 error 21 hints.

    Strong-mode analysis of lib/asn1null.dart failed with the following error:

    line: 9 col: 3
    Invalid override. The type of 'ASN1Null.encodedBytes' ('() → List<dynamic>') isn't a subtype of 'ASN1Object.encodedBytes' ('() → Uint8List').

    Run dartfmt to format lib/asn1bitstring.dart.

    Similar analysis of the following files failed:

    • lib/asn1boolean.dart (hint)
    • lib/asn1constants.dart (hint)
    • lib/asn1enumerated.dart (hint)
    • lib/asn1exception.dart (hint)
    • lib/asn1length.dart (hint)
    • lib/asn1lib.dart (hint)
    • lib/asn1object.dart (hint)
    • lib/asn1objectidentifier.dart (hint)
    • lib/asn1octetstring.dart (hint)
    • lib/asn1parser.dart (hint)
    • lib/asn1printablestring.dart (hint)
    • lib/asn1sequence.dart (hint)
    • lib/asn1set.dart (hint)
    • lib/asn1utctime.dart (hint)
    • lib/asn1util.dart (hint)
  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use asn1lib.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0
bignum >=0.0.5 <1.0.0 0.1.0
Transitive dependencies
fixnum 0.10.7
Dev dependencies
convert ^1.1.1
test any