app: restructure and start building p15 output

This commit is contained in:
Greg T. Wallace 2024-01-25 20:16:37 -05:00
commit e2e4f2037c
24 changed files with 622 additions and 168 deletions
pkg/tools/asn1obj

View file

@ -0,0 +1,23 @@
package asn1obj
import (
"encoding/asn1"
)
// OctetString returns an OCTET STRING of the content
func OctetString(content []byte) []byte {
raw := asn1.RawValue{
Class: asn1.ClassUniversal,
Tag: asn1.TagOctetString,
IsCompound: false,
Bytes: content,
}
// should never error
asn1result, err := asn1.Marshal(raw)
if err != nil {
panic(err)
}
return asn1result
}