diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2015-07-14 18:21:49 +0200 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2015-07-14 18:21:49 +0200 |
commit | affb3bc6b3dcfd80b6f2fa778abbf0c1705b643b (patch) | |
tree | 47868d992a83b061e0c07a4008d2cda20e2f9ab8 /ber | |
parent | 7b3803f2588cae3120baa4bce24b5e4c671b3694 (diff) |
Add identfier
Diffstat (limited to 'ber')
-rw-r--r-- | ber/class.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ber/class.go b/ber/class.go index bc83651..67a4dcd 100644 --- a/ber/class.go +++ b/ber/class.go @@ -126,3 +126,23 @@ func Length(b []byte) (int, int) { return int(b[0]), 1 } } + +func Unversal(b []byte) (int, bool) { + c, _, t, _ := Ident(b) + return int(t), c == classUniversal +} + +func Application(b []byte) (int, bool) { + c, _, t, _ := Ident(b) + return int(t), c == classApplication +} + +func ContextSpecific(b []byte) (int, bool) { + c, _, t, _ := Ident(b) + return int(t), c == classContextSpecific +} + +func Private(b []byte) (int, bool) { + c, _, t, _ := Ident(b) + return int(t), c == classPrivate +} |