The asn1 Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The asn1 Reference Manual

This is the asn1 Reference Manual, version 0.1.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Sun May 15 03:19:53 2022 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

asn1

ASN.1 encoder/decoder.

Usage

Decoding from a Base64 string

(ql:quickload '(:asn1 :cl-base64))

(defvar *public-key*
  (base64:base64-string-to-usb8-array
   "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAum9xmq7qBsjYU3gNFB6z
2DyQypeGvwR3MqbA5x4sevYjeqRunFRq+oo6CyEjzC/zR8xh7NvLFwXImSmyYadU
d+jstH1Kn5MJtBfCwlGSAXRfn6QV8wr+oweWvyDNUgCkgM+6X7Q7wyH8pib9J2WA
R6QcY3GRD+P+c/ZNwlgDSBVWzSUE2Sw1GBXadgEDdTMq/DnGmGmsMIdgCMxJ+szA
Av+dWJhuUPlp5zoFhyxayyJMCAND3llFpmv85bIKfQb8EDkQjtFLOEbU0KIY4pPj
KL01P4pDiqFFo6PWOJUHO5vyeLDWWCl1itOKeGxHvyxNQG/0BvQquxpjNjHZYCk0
cwIDAQAB"))

(asn1:decode *public-key*)
;=> ((:SEQUENCE (:SEQUENCE (:OBJECT-IDENTIFIER . #(1 2 840 113549 1 1 1)) (:NULL))
;     (:BIT-STRING
;      . #(48 130 1 10 2 130 1 1 0 186 111 113 154 174 234 6 200 216 83 120 13 20
;          30 179 216 60 144 202 151 134 191 4 119 50 166 192 231 30 44 122 246 35
;          122 164 110 156 84 106 250 138 58 11 33 35 204 47 243 71 204 97 236 219
;          203 23 5 200 153 41 178 97 167 84 119 232 236 180 125 74 159 147 9 180
;          23 194 194 81 146 1 116 95 159 164 21 243 10 254 163 7 150 191 32 205 82
;          0 164 128 207 186 95 180 59 195 33 252 166 38 253 39 101 128 71 164 28
;          99 113 145 15 227 254 115 246 77 194 88 3 72 21 86 205 37 4 217 44 53 24
;          21 218 118 1 3 117 51 42 252 57 198 152 105 172 48 135 96 8 204 73 250
;          204 192 2 255 157 88 152 110 80 249 105 231 58 5 135 44 90 203 34 76 8 3
;          67 222 89 69 166 107 252 229 178 10 125 6 252 16 57 16 142 209 75 56 70
;          212 208 162 24 226 147 227 40 189 53 63 138 67 138 161 69 163 163 214 56
;          149 7 59 155 242 120 176 214 88 41 117 138 211 138 120 108 71 191 44 77
;          64 111 244 6 244 42 187 26 99 54 49 217 96 41 52 115 2 3 1 0 1))))

Using with Trivia & Ironclad

(ql:quickload '(:trivia :ironclad))

(trivia:match (asn1:decode *public-key*)
  ((asn1:rsa-public-key-info n e)
   (ironclad:make-public-key :rsa :n n :e e)))
;=> #<IRONCLAD::RSA-PUBLIC-KEY {1004C2BA63}>


(trivia:match (asn1:decode *private-key*)
  ((asn1:rsa-private-key :modulus n
                         :public-exponent e
                         :private-exponent d
                         :prime1 p
                         :prime2 q)
   (ironclad:make-private-key :rsa :n n :e e :d d :p p :q q)))
;=> #<IRONCLAD:RSA-PRIVATE-KEY {1005C460F3}>

Author

Copyright

Copyright (c) 2017 Eitaro Fukamachi (e.arrows@gmail.com)

License

Licensed under the BSD 2-Clause License.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Next: , Previous: , Up: Systems   [Contents][Index]

2.1 asn1

Author

Eitaro Fukamachi

License

BSD 2-Clause

Description

ASN.1 encoder/decoder

Version

0.1.0

Dependency

asn1/main (system)

Source

asn1.asd (file)


Next: , Previous: , Up: Systems   [Contents][Index]

2.2 asn1/main

Author

Eitaro Fukamachi

License

BSD 2-Clause

Dependencies
Source

asn1.asd (file)

Component

file-type.lisp (file)


Next: , Previous: , Up: Systems   [Contents][Index]

2.3 asn1/encode

Author

Eitaro Fukamachi

License

BSD 2-Clause

Dependencies
Source

asn1.asd (file)

Component

file-type.lisp (file)


Next: , Previous: , Up: Systems   [Contents][Index]

2.4 asn1/format/rsa

Author

Eitaro Fukamachi

License

BSD 2-Clause

Dependencies
Source

asn1.asd (file)

Component

file-type.lisp (file)


Next: , Previous: , Up: Systems   [Contents][Index]

2.5 asn1/format/public-key

Author

Eitaro Fukamachi

License

BSD 2-Clause

Dependency

trivia

Source

asn1.asd (file)

Component

file-type.lisp (file)


Previous: , Up: Systems   [Contents][Index]

2.6 asn1/decode

Author

Eitaro Fukamachi

License

BSD 2-Clause

Source

asn1.asd (file)

Component

file-type.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 asn1.asd

Location

asn1.asd

Systems

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 asn1/main/file-type.lisp

Parent

asn1/main (system)

Location

main.lisp

Packages

asn1


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 asn1/encode/file-type.lisp

Parent

asn1/encode (system)

Location

encode.lisp

Packages

asn1/encode

Exported Definitions

encode (function)

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.4 asn1/format/rsa/file-type.lisp

Parent

asn1/format/rsa (system)

Location

format/rsa.lisp

Packages

asn1/format/rsa


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.5 asn1/format/public-key/file-type.lisp

Parent

asn1/format/public-key (system)

Location

format/public-key.lisp

Packages

asn1/format/public-key


Previous: , Up: Lisp files   [Contents][Index]

3.1.6 asn1/decode/file-type.lisp

Parent

asn1/decode (system)

Location

decode.lisp

Packages

asn1/decode

Exported Definitions

decode (function)

Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 asn1

Source

file-type.lisp (file)

Nickname

asn1/main

Use List

Next: , Previous: , Up: Packages   [Contents][Index]

4.2 asn1/encode

Source

file-type.lisp (file)

Use List

common-lisp

Used By List

asn1

Exported Definitions

encode (function)

Internal Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

4.3 asn1/format/rsa

Source

file-type.lisp (file)

Use List
Used By List

asn1


Next: , Previous: , Up: Packages   [Contents][Index]

4.4 asn1/format/public-key

Source

file-type.lisp (file)

Use List

common-lisp

Used By List

asn1/format/rsa


Previous: , Up: Packages   [Contents][Index]

4.5 asn1/decode

Source

file-type.lisp (file)

Use List

common-lisp

Used By List

asn1

Exported Definitions

decode (function)

Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: decode DATA &key START END
Package

asn1/decode

Source

file-type.lisp (file)

Function: encode ASN1
Package

asn1/encode

Source

file-type.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *buffer*
Package

asn1/encode

Source

file-type.lisp (file)

Special Variable: +tag-types+
Package

asn1/encode

Source

file-type.lisp (file)

Special Variable: +tag-types+
Package

asn1/decode

Source

file-type.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: bytes-to-integer DATA START END
Package

asn1/decode

Source

file-type.lisp (file)

Function: bytes-to-oid DATA START END
Package

asn1/decode

Source

file-type.lisp (file)

Function: length-to-octets LEN
Package

asn1/encode

Source

file-type.lisp (file)

Function: oid-to-octets OID
Package

asn1/encode

Source

file-type.lisp (file)

Function: read-block DATA &key START
Package

asn1/decode

Source

file-type.lisp (file)

Function: write-block ASN1 BUFFER
Package

asn1/encode

Source

file-type.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Types

Type: octets &optional LEN
Package

asn1/decode

Source

file-type.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   A   F   L  
Index Entry  Section

A
asn1.asd: The asn1․asd file
asn1/decode/file-type.lisp: The asn1/decode/file-type․lisp file
asn1/encode/file-type.lisp: The asn1/encode/file-type․lisp file
asn1/format/public-key/file-type.lisp: The asn1/format/public-key/file-type․lisp file
asn1/format/rsa/file-type.lisp: The asn1/format/rsa/file-type․lisp file
asn1/main/file-type.lisp: The asn1/main/file-type․lisp file

F
File, Lisp, asn1.asd: The asn1․asd file
File, Lisp, asn1/decode/file-type.lisp: The asn1/decode/file-type․lisp file
File, Lisp, asn1/encode/file-type.lisp: The asn1/encode/file-type․lisp file
File, Lisp, asn1/format/public-key/file-type.lisp: The asn1/format/public-key/file-type․lisp file
File, Lisp, asn1/format/rsa/file-type.lisp: The asn1/format/rsa/file-type․lisp file
File, Lisp, asn1/main/file-type.lisp: The asn1/main/file-type․lisp file

L
Lisp File, asn1.asd: The asn1․asd file
Lisp File, asn1/decode/file-type.lisp: The asn1/decode/file-type․lisp file
Lisp File, asn1/encode/file-type.lisp: The asn1/encode/file-type․lisp file
Lisp File, asn1/format/public-key/file-type.lisp: The asn1/format/public-key/file-type․lisp file
Lisp File, asn1/format/rsa/file-type.lisp: The asn1/format/rsa/file-type․lisp file
Lisp File, asn1/main/file-type.lisp: The asn1/main/file-type․lisp file

Jump to:   A   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   B   D   E   F   L   O   R   W  
Index Entry  Section

B
bytes-to-integer: Internal functions
bytes-to-oid: Internal functions

D
decode: Exported functions

E
encode: Exported functions

F
Function, bytes-to-integer: Internal functions
Function, bytes-to-oid: Internal functions
Function, decode: Exported functions
Function, encode: Exported functions
Function, length-to-octets: Internal functions
Function, oid-to-octets: Internal functions
Function, read-block: Internal functions
Function, write-block: Internal functions

L
length-to-octets: Internal functions

O
oid-to-octets: Internal functions

R
read-block: Internal functions

W
write-block: Internal functions

Jump to:   B   D   E   F   L   O   R   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *   +  
S  
Index Entry  Section

*
*buffer*: Internal special variables

+
+tag-types+: Internal special variables
+tag-types+: Internal special variables

S
Special Variable, *buffer*: Internal special variables
Special Variable, +tag-types+: Internal special variables
Special Variable, +tag-types+: Internal special variables

Jump to:   *   +  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   A   O   P   S   T  
Index Entry  Section

A
asn1: The asn1 system
asn1: The asn1 package
asn1/decode: The asn1/decode system
asn1/decode: The asn1/decode package
asn1/encode: The asn1/encode system
asn1/encode: The asn1/encode package
asn1/format/public-key: The asn1/format/public-key system
asn1/format/public-key: The asn1/format/public-key package
asn1/format/rsa: The asn1/format/rsa system
asn1/format/rsa: The asn1/format/rsa package
asn1/main: The asn1/main system

O
octets: Internal types

P
Package, asn1: The asn1 package
Package, asn1/decode: The asn1/decode package
Package, asn1/encode: The asn1/encode package
Package, asn1/format/public-key: The asn1/format/public-key package
Package, asn1/format/rsa: The asn1/format/rsa package

S
System, asn1: The asn1 system
System, asn1/decode: The asn1/decode system
System, asn1/encode: The asn1/encode system
System, asn1/format/public-key: The asn1/format/public-key system
System, asn1/format/rsa: The asn1/format/rsa system
System, asn1/main: The asn1/main system

T
Type, octets: Internal types

Jump to:   A   O   P   S   T