Lev Walkin | ce8ccfa | 2004-08-20 13:38:07 +0000 | [diff] [blame] | 1 | |
| 2 | Q: Your compiler supplies a der_encode() procedure. How do I encode BER? |
| 3 | A: |
| 4 | The DER (and CER) are stricter subsets of a more generic BER encoding |
| 5 | method. If you encode data with DER or CER, all BER-conformant decoders |
| 6 | will easily understand that. Hence, to encode data in the BER format, |
| 7 | simply use the DER encoder, der_encode(). |
| 8 | |
| 9 | See also: ISO/IEC 8825-1 / X.690: |
| 10 | "ASN.1 encoding rules: Specification of |
| 11 | Basic Encoding Rules (BER), |
| 12 | Canonical Encoding Rules (CER) and |
| 13 | Distinguished Encoding Rules (DER)" |
| 14 | |
Lev Walkin | e057ca3 | 2004-09-05 10:41:17 +0000 | [diff] [blame] | 15 | |
| 16 | Q: I've tried doing ./asn1c/asn1c -P examples/*PKIX*93*, but compiler spits |
| 17 | several fatal failures and exits. |
| 18 | A: |
Lev Walkin | 9567bb7 | 2004-09-07 06:42:40 +0000 | [diff] [blame] | 19 | The old (RFC2459) PKIX1 specifications used ASN.1 Information Object |
| 20 | Classes, which is arguably one of the most complex ASN.1 concepts. |
Lev Walkin | e057ca3 | 2004-09-05 10:41:17 +0000 | [diff] [blame] | 21 | |
| 22 | The asn1c parser and fixer subsystems currently understand most of |
| 23 | IOC syntax, but the compiler can cope with only the very basic |
| 24 | IOC semantics. |
| 25 | |
| 26 | The goal of asn1c is to adequately support the practically necessary |
| 27 | subset of IOCs to compile PKIX1 and other real-world specs, |
| 28 | but this milestone isn't yet reached. Please contact me in case |
| 29 | you have special requirements, we can work it out. |
| 30 | |
Lev Walkin | 9567bb7 | 2004-09-07 06:42:40 +0000 | [diff] [blame] | 31 | However, the asn1c compiler is able to understand the newer PKIX1 |
Lev Walkin | 20d7d90 | 2004-10-03 10:54:05 +0000 | [diff] [blame] | 32 | ASN.1 specs, contained in RFC3280, which obsoletes RFC2459. |
| 33 | To compile the sample X.509 certificate dump utility, try this out: |
Lev Walkin | e057ca3 | 2004-09-05 10:41:17 +0000 | [diff] [blame] | 34 | |
Lev Walkin | 59d426e | 2004-09-23 22:18:25 +0000 | [diff] [blame] | 35 | cd ./examples/sample.source.PKIX1 |
| 36 | make |
| 37 | ./x509dump -h |
| 38 | |
Lev Walkin | e057ca3 | 2004-09-05 10:41:17 +0000 | [diff] [blame] | 39 | |
| 40 | -- |
| 41 | Lev Walkin |
| 42 | vlm@lionet.info |