mirror of
https://github.com/gregtwallace/apc-p15-tool.git
synced 2025-01-22 08:14:08 +00:00
26 lines
478 B
Go
26 lines
478 B
Go
package asn1obj
|
|
|
|
import "encoding/asn1"
|
|
|
|
// Sequence returns an ASN.1 SEQUENCE with the specified content
|
|
func Sequence(content [][]byte) []byte {
|
|
val := []byte{}
|
|
for i := range content {
|
|
val = append(val, content[i]...)
|
|
}
|
|
|
|
raw := asn1.RawValue{
|
|
Class: asn1.ClassUniversal,
|
|
Tag: asn1.TagSequence,
|
|
IsCompound: true,
|
|
Bytes: val,
|
|
}
|
|
|
|
// should never error
|
|
asn1result, err := asn1.Marshal(raw)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
return asn1result
|
|
}
|