L. Cornelius Dol
L. Cornelius Dol

Reputation: 64065

Is there a free package for reading, manipulating and writing ASN.1 in Java?

Is there a free package for reading, manipulating and writing ASN.1 in Java?

It must be:

  1. Free
  2. Lightweight
  3. Self-contained (without external dependencies on, e.g. Apache commons)
  4. Java 5 (not Java 6), and Java 4 is preferred.

Upvotes: 8

Views: 1383

Answers (5)

Eliezio Oliveira
Eliezio Oliveira

Reputation: 153

I had basically the same set of requirements and found this asn-one - ASN.1 library for Java perfect for my case.

  • It's Apache 2.0 License
  • Pretty small (65 KiB)
  • It's Java 7+ compatible, however. That may not be a major problem for most projects nowadays.

Upvotes: 0

Stefan Feuerhahn
Stefan Feuerhahn

Reputation: 1814

You could use jASN1. It is licensed under LGPL and should satisfy all of your needs. It is also very efficient.

Upvotes: 2

emboss
emboss

Reputation: 39650

I need to be able to parse any kind of ASN.1 data in krypt. Although krypt is a Ruby project, you may want to have a look at the JRuby extension - the code for handling ASN.1 parsing/encoding is written entirely in Java and modular enough for easy extraction.

I also made a Java-only version, but it is missing some of the higher-level functionality of the former. But since it's concise, maybe it's a good opportunity to get you started.

Both are free of any additional dependencies and use only standard JDK functionality.

Upvotes: 0

L. Cornelius Dol
L. Cornelius Dol

Reputation: 64065

The following project looks promising:

http://www.chaosinmotion.com/wiki/index.php?title=ASN.1_Library

It is provided under a liberal BSD-style licence.

It is small, 41 classes compiling to 55KiB.

It compiled clean with no dependencies to Java 3.

Upvotes: 5

erickson
erickson

Reputation: 269847

The free BouncyCastle library provides low-level ASN.1 parsing. You don't need to install BC as a provider to use the ASN.1 capabilities. It has different versions for 1.4 and up. It has no external dependencies. As the default bundle contains all of the BC provider classes, you may want to repackage it if you want something more compact.

Upvotes: 2

Related Questions