aboutsummaryrefslogtreecommitdiff
path: root/ber
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-07-14 18:21:49 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-07-14 18:21:49 +0200
commitaffb3bc6b3dcfd80b6f2fa778abbf0c1705b643b (patch)
tree47868d992a83b061e0c07a4008d2cda20e2f9ab8 /ber
parent7b3803f2588cae3120baa4bce24b5e4c671b3694 (diff)
Add identfier
Diffstat (limited to 'ber')
-rw-r--r--ber/class.go20
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
+}