| 1 | // Copyright 2017 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | // Package asn1 contains supporting types for parsing and building ASN.1 |
| 6 | // messages with the cryptobyte package. |
| 7 | package asn1scip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/ |
| 8 | |
| 9 | // Tag represents an ASN.1 identifier octet, consisting of a tag number |
| 10 | // (indicating a type) and class (such as context-specific or constructed). |
| 11 | // |
| 12 | // Methods in the cryptobyte package only support the low-tag-number form, i.e. |
| 13 | // a single identifier octet with bits 7-8 encoding the class and bits 1-6 |
| 14 | // encoding the tag number. |
| 15 | type Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag# uint8 |
| 16 | |
| 17 | const ( |
| 18 | classConstructedscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/classConstructed. = 0x20 |
| 19 | classContextSpecificscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/classContextSpecific. = 0x80 |
| 20 | ) |
| 21 | |
| 22 | // Constructed returns t with the constructed class bit set. |
| 23 | func (t Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#) Constructedscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#Constructed().() Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag# { return t | classConstructedscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/classConstructed. } |
| 24 | |
| 25 | // ContextSpecific returns t with the context-specific class bit set. |
| 26 | func (t Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#) ContextSpecificscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#ContextSpecific().() Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag# { return t | classContextSpecificscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/classContextSpecific. } |
| 27 | |
| 28 | // The following is a list of standard tag and class combinations. |
| 29 | const ( |
| 30 | BOOLEANscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/BOOLEAN. = Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#(1) |
| 31 | INTEGERscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/INTEGER. = Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#(2) |
| 32 | BIT_STRINGscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/BIT_STRING. = Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#(3) |
| 33 | OCTET_STRINGscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/OCTET_STRING. = Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#(4) |
| 34 | NULLscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/NULL. = Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#(5) |
| 35 | OBJECT_IDENTIFIERscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/OBJECT_IDENTIFIER. = Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#(6) |
| 36 | ENUMscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/ENUM. = Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#(10) |
| 37 | UTF8Stringscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/UTF8String. = Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#(12) |
| 38 | SEQUENCEscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/SEQUENCE. = Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#(16 | classConstructedscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/classConstructed.) |
| 39 | SETscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/SET. = Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#(17 | classConstructedscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/classConstructed.) |
| 40 | PrintableStringscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/PrintableString. = Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#(19) |
| 41 | T61Stringscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/T61String. = Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#(20) |
| 42 | IA5Stringscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/IA5String. = Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#(22) |
| 43 | UTCTimescip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/UTCTime. = Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#(23) |
| 44 | GeneralizedTimescip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/GeneralizedTime. = Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#(24) |
| 45 | GeneralStringscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/GeneralString. = Tagscip-go gomod github.com/smallstep/pkcs7 . `github.com/smallstep/pkcs7/internal/cryptobyte/asn1`/Tag#(27) |
| 46 | ) |