Pop-Up Thingie
Sidebar
Too Lazy BBS
Home
Forum
Files
Chat
Bulletins
Top doors
MOTD
BBS Stats
Dark
Register
Log in
Username
Password
Sidebar
Forum
USENET
comp.lang.postscript
Parse ASN.1 DER format
From
news
@news@zzo38computer.org.invalid to
comp.lang.postscript
on Wed Oct 22 14:38:43 2025
From Newsgroup: comp.lang.postscript
I wrote a PostScript code to parse ASN.1 DER format. (This file is
public domain.)
Currently it only implements decoding and not encoding. Also, it only
decodes the framing and does not decode values.
/ASN1class [/Universal /Application /Context /Private] def
/ASN1parse {
dup read {
<< >> begin
/Tag exch def
/File exch def
/Constructed Tag -5 bitshift 0 ne def
/Class //ASN1class Tag -6 bitshift get def
/Tag Tag 16#1F and dup 16#1F eq {
pop 0 {File read {
exch 7 bitshift 1 index 16#7F and or
exch 16#80 lt {exit} if
} {exit} ifelse} loop
} if def
/Length File read pop def
Length 16#80 ge {
/Length 0 Length 16#7F and {
8 bitshift File read {or} if
} repeat def
} if
/Data Constructed {
/File File Length () /SubFileDecode filter def
[{File ASN1parse not {exit} if} loop]
} {
Length 0 eq {()} {File Length string readstring pop} ifelse
} ifelse def
{File Constructed Length} {currentdict exch undef} forall
currentdict end //true
} {
pop //false
} ifelse
} bind def
--
Don't laugh at the moon when it is day time in France.
--- Synchronet 3.21a-Linux NewsLink 1.2
Who's Online
Recent Visitors
Widgit
Sun Jan 11 18:29:52 2026
from
New Zealand
via
Telnet
Geek2
Sun Jan 11 14:07:03 2026
from
Euclid, Oh
via
Telnet
Geek2
Sun Jan 11 11:15:24 2026
from
Euclid, Oh
via
Telnet
Crackerchest
Sun Jan 11 08:12:39 2026
from
Usa
via
Telnet
System Info
Sysop:
Amessyroom
Location:
Fayetteville, NC
Users:
54
Nodes:
6 (
0
/
6
)
Uptime:
13:33:51
Calls:
742
Files:
1,218
D/L today:
2 files
(2,024K bytes)
Messages:
183,470
Posted today:
1