func AddASNAppTag(b []byte, tag int) []byte {
	r := asn1.RawValue{
		Class:      asn1.ClassApplication,
		IsCompound: true,
		Tag:        tag,
		Bytes:      b,
	}
	ab, _ := asn1.Marshal(r)
	return ab
}
AddASNAppTag adds an ASN1 encoding application tag value to the raw bytes provided.
package asn1tools
import (
	"github.com/jcmturner/gofork/encoding/asn1"
)
func MarshalLengthBytes(l int) []byte {
	if l <= 127 {
		return []byte{byte(l)}
	}
	var b []byte
	p := 1
	for i := 1; i < 127; {
		b = append([]byte{byte((l % (p * 256)) / p)}, b...)
		p = p * 256
		l = l - l%p
		if l <= 0 {
			break
		}
	}
	return append([]byte{byte(128 + len(b))}, b...)
}
func GetLengthFromASN(b []byte) int {
	if int(b[1]) <= 127 {
		return int(b[1])
	}
	lb := b[2 : 2+int(b[1])-128]
	base := 1
	l := 0
	for i := len(lb) - 1; i >= 0; i-- {
		l += int(lb[i]) * base
		base = base * 256
	}
	return l
}
func GetNumberBytesInLengthHeader(b []byte) int {
	if int(b[1]) <= 127 {
		return 1
	}
	return 1 + int(b[1]) - 128
}