aboutsummaryrefslogtreecommitdiff
path: root/ber/class.go
diff options
context:
space:
mode:
Diffstat (limited to 'ber/class.go')
-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
+}