From affb3bc6b3dcfd80b6f2fa778abbf0c1705b643b Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 14 Jul 2015 18:21:49 +0200 Subject: Add identfier --- ber/class.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'ber') 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 +} -- cgit v1.2.3