This discussion might give you some idea, which direction to go. On a
similar occasion, I took JNI and used a commercial C library for a
sepecial embedded OS; that was 2 years before though and nowadays those
libraries, mensioned in this forum discussion, look to be mature enough.
Let me know If you plan to implement it yourself for a special
deployment environment and need further help on the ASN1(BER) encoding.
The original discussion:
forum.java.sun.com/thread.jspa?threadID=657620
and the standard specification (you sure already have that but for the
records)
http://www.ietf.org/rfc/rfc1157.txt