app: restructure and start building p15 output

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

19
pkg/tools/asn1obj/oid.go Normal file
View file

@ -0,0 +1,19 @@
package asn1obj
import "encoding/asn1"
var (
OIDPkscs15Content = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 15, 3, 1} // pkcs15content (PKCS #15 content type)
OIDrsaEncryptionPKCS1 = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 1} // rsaEncryption (PKCS #1)
)
// ObjectIdentifier returns an ASN.1 OBJECT IDENTIFIER with the oidValue bytes
func ObjectIdentifier(oid asn1.ObjectIdentifier) []byte {
// should never error
asn1result, err := asn1.Marshal(oid)
if err != nil {
panic(err)
}
return asn1result
}