| 1 | // Copyright 2014 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 pkixscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/ |
| 6 | |
| 7 | import ( |
| 8 | "encoding/jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/" |
| 9 | "errorsscip-go gomod github.com/golang/go/src go1.16 errors/" |
| 10 | "strconvscip-go gomod github.com/golang/go/src go1.16 strconv/" |
| 11 | "stringsscip-go gomod github.com/golang/go/src go1.16 strings/" |
| 12 | |
| 13 | "github.com/zmap/zcrypto/encoding/asn1scip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/" |
| 14 | ) |
| 15 | |
| 16 | type auxAttributeTypeAndValuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxAttributeTypeAndValue# struct { |
| 17 | Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxAttributeTypeAndValue#Type. string `json:"type,omitempty"` |
| 18 | Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxAttributeTypeAndValue#Value. string `json:"value,omitempty"` |
| 19 | } |
| 20 | |
| 21 | // MarshalJSON implements the json.Marshaler interface. |
| 22 | func (a *AttributeTypeAndValuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#) MarshalJSONscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#MarshalJSON().() ([]byte, error) { |
| 23 | aux := auxAttributeTypeAndValuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxAttributeTypeAndValue#{} |
| 24 | aux.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxAttributeTypeAndValue#Type. = a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Stringscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#String().() |
| 25 | if s, ok := a.Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Value..(string); ok { |
| 26 | aux.Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxAttributeTypeAndValue#Value. = s |
| 27 | } |
| 28 | return jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/.Marshalscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/Marshal().(&aux) |
| 29 | } |
| 30 | |
| 31 | // UnmarshalJSON implements the json.Unmarshaler interface. |
| 32 | func (a *AttributeTypeAndValuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#) UnmarshalJSONscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#UnmarshalJSON().(b []byte) error { |
| 33 | aux := auxAttributeTypeAndValuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxAttributeTypeAndValue#{} |
| 34 | if err := jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/Unmarshal().(b, &aux); err != nil { |
| 35 | return err |
| 36 | } |
| 37 | a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type. = nil |
| 38 | if len(aux.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxAttributeTypeAndValue#Type.) > 0 { |
| 39 | parts := stringsscip-go gomod github.com/golang/go/src go1.16 strings/.Splitscip-go gomod github.com/golang/go/src go1.16 strings/Split().(aux.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxAttributeTypeAndValue#Type., ".") |
| 40 | for _, part := range parts { |
| 41 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.Atoiscip-go gomod github.com/golang/go/src go1.16 strconv/Atoi().(part) |
| 42 | if err != nil { |
| 43 | return err |
| 44 | } |
| 45 | a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type. = append(a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type., i) |
| 46 | } |
| 47 | } |
| 48 | a.Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Value. = aux.Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxAttributeTypeAndValue#Value. |
| 49 | return nil |
| 50 | } |
| 51 | |
| 52 | type auxOtherNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxOtherName# struct { |
| 53 | IDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxOtherName#ID. string `json:"id,omitempty"` |
| 54 | Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxOtherName#Value. []byte `json:"value,omitempty"` |
| 55 | } |
| 56 | |
| 57 | // MarshalJSON implements the json.Marshaler interface. |
| 58 | func (o *OtherNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/OtherName#) MarshalJSONscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/OtherName#MarshalJSON().() ([]byte, error) { |
| 59 | aux := auxOtherNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxOtherName#{ |
| 60 | IDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxOtherName#ID.: o.TypeIDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/OtherName#TypeID..Stringscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#String().(), |
| 61 | Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxOtherName#Value.: o.Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/OtherName#Value..Bytesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/RawValue#Bytes., |
| 62 | } |
| 63 | return jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/.Marshalscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/Marshal().(&aux) |
| 64 | } |
| 65 | |
| 66 | // UnmarshalJSON implements the json.Unmarshaler interface. |
| 67 | func (o *OtherNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/OtherName#) UnmarshalJSONscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/OtherName#UnmarshalJSON().(b []byte) (err error) { |
| 68 | aux := auxOtherNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxOtherName#{} |
| 69 | if err = jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/Unmarshal().(b, &aux); err != nil { |
| 70 | return |
| 71 | } |
| 72 | |
| 73 | // Turn dot-notation back into an OID |
| 74 | if len(aux.IDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxOtherName#ID.) == 0 { |
| 75 | return errorsscip-go gomod github.com/golang/go/src go1.16 errors/.Newscip-go gomod github.com/golang/go/src go1.16 errors/New().("empty type ID") |
| 76 | } |
| 77 | parts := stringsscip-go gomod github.com/golang/go/src go1.16 strings/.Splitscip-go gomod github.com/golang/go/src go1.16 strings/Split().(aux.IDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxOtherName#ID., ".") |
| 78 | o.TypeIDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/OtherName#TypeID. = nil |
| 79 | for _, part := range parts { |
| 80 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.Atoiscip-go gomod github.com/golang/go/src go1.16 strconv/Atoi().(part) |
| 81 | if err != nil { |
| 82 | return err |
| 83 | } |
| 84 | o.TypeIDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/OtherName#TypeID. = append(o.TypeIDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/OtherName#TypeID., i) |
| 85 | } |
| 86 | |
| 87 | // Build the ASN.1 value |
| 88 | o.Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/OtherName#Value. = asn1scip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/.RawValuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/RawValue#{ |
| 89 | Tagscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/RawValue#Tag.: 0, |
| 90 | Classscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/RawValue#Class.: asn1scip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/.ClassContextSpecificscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ClassContextSpecific., |
| 91 | IsCompoundscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/RawValue#IsCompound.: true, |
| 92 | Bytesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/RawValue#Bytes.: aux.Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxOtherName#Value., |
| 93 | } |
| 94 | o.Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/OtherName#Value..FullBytesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/RawValue#FullBytes., err = asn1scip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/.Marshalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/Marshal().(o.Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/OtherName#Value.) |
| 95 | return |
| 96 | } |
| 97 | |
| 98 | type auxExtensionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxExtension# struct { |
| 99 | IDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxExtension#ID. string `json:"id,omitempty"` |
| 100 | Criticalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxExtension#Critical. bool `json:"critical"` |
| 101 | Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxExtension#Value. []byte `json:"value,omitempty"` |
| 102 | } |
| 103 | |
| 104 | // MarshalJSON implements the json.Marshaler interface. |
| 105 | func (ext *Extensionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Extension#) MarshalJSONscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Extension#MarshalJSON().() ([]byte, error) { |
| 106 | aux := auxExtensionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxExtension#{ |
| 107 | IDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxExtension#ID.: ext.Idscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Extension#Id..Stringscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#String().(), |
| 108 | Criticalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxExtension#Critical.: ext.Criticalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Extension#Critical., |
| 109 | Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxExtension#Value.: ext.Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Extension#Value., |
| 110 | } |
| 111 | return jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/.Marshalscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/Marshal().(&aux) |
| 112 | } |
| 113 | |
| 114 | // UnmarshalJSON implements the json.Unmarshaler interface. |
| 115 | func (ext *Extensionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Extension#) UnmarshalJSONscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Extension#UnmarshalJSON().(b []byte) (err error) { |
| 116 | aux := auxExtensionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxExtension#{} |
| 117 | if err = jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/Unmarshal().(b, &aux); err != nil { |
| 118 | return |
| 119 | } |
| 120 | |
| 121 | parts := stringsscip-go gomod github.com/golang/go/src go1.16 strings/.Splitscip-go gomod github.com/golang/go/src go1.16 strings/Split().(aux.IDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxExtension#ID., ".") |
| 122 | for _, part := range parts { |
| 123 | i, err := strconvscip-go gomod github.com/golang/go/src go1.16 strconv/.Atoiscip-go gomod github.com/golang/go/src go1.16 strconv/Atoi().(part) |
| 124 | if err != nil { |
| 125 | return err |
| 126 | } |
| 127 | ext.Idscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Extension#Id. = append(ext.Idscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Extension#Id., i) |
| 128 | } |
| 129 | ext.Criticalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Extension#Critical. = aux.Criticalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxExtension#Critical. |
| 130 | ext.Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Extension#Value. = aux.Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxExtension#Value. |
| 131 | return |
| 132 | } |
| 133 | |
| 134 | type auxNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName# struct { |
| 135 | CommonNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#CommonName. []string `json:"common_name,omitempty"` |
| 136 | SerialNumberscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#SerialNumber. []string `json:"serial_number,omitempty"` |
| 137 | Countryscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Country. []string `json:"country,omitempty"` |
| 138 | Localityscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Locality. []string `json:"locality,omitempty"` |
| 139 | Provincescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Province. []string `json:"province,omitempty"` |
| 140 | StreetAddressscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#StreetAddress. []string `json:"street_address,omitempty"` |
| 141 | Organizationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Organization. []string `json:"organization,omitempty"` |
| 142 | OrganizationalUnitscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#OrganizationalUnit. []string `json:"organizational_unit,omitempty"` |
| 143 | PostalCodescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#PostalCode. []string `json:"postal_code,omitempty"` |
| 144 | DomainComponentscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#DomainComponent. []string `json:"domain_component,omitempty"` |
| 145 | EmailAddressscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#EmailAddress. []string `json:"email_address,omitempty"` |
| 146 | GivenNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#GivenName. []string `json:"given_name,omitempty"` |
| 147 | Surnamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Surname. []string `json:"surname,omitempty"` |
| 148 | // EV |
| 149 | JurisdictionCountryscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#JurisdictionCountry. []string `json:"jurisdiction_country,omitempty"` |
| 150 | JurisdictionLocalityscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#JurisdictionLocality. []string `json:"jurisdiction_locality,omitempty"` |
| 151 | JurisdictionProvincescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#JurisdictionProvince. []string `json:"jurisdiction_province,omitempty"` |
| 152 | |
| 153 | // QWACS |
| 154 | OrganizationIDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#OrganizationID. []string `json:"organization_id,omitempty"` |
| 155 | |
| 156 | UnknownAttributesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#UnknownAttributes. []AttributeTypeAndValuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue# `json:"-"` |
| 157 | } |
| 158 | |
| 159 | // MarshalJSON implements the json.Marshaler interface. |
| 160 | func (n *Namescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#) MarshalJSONscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#MarshalJSON().() ([]byte, error) { |
| 161 | aux := auxNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#{} |
| 162 | attrs := n.ToRDNSequencescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#ToRDNSequence().() |
| 163 | for _, attrSet := range attrs { |
| 164 | for _, a := range attrSet { |
| 165 | s, ok := a.Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Value..(string) |
| 166 | if !ok { |
| 167 | continue |
| 168 | } |
| 169 | if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidCommonNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidCommonName.) { |
| 170 | aux.CommonNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#CommonName. = append(aux.CommonNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#CommonName., s) |
| 171 | } else if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidSurnamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidSurname.) { |
| 172 | aux.Surnamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Surname. = append(aux.Surnamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Surname., s) |
| 173 | } else if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidSerialNumberscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidSerialNumber.) { |
| 174 | aux.SerialNumberscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#SerialNumber. = append(aux.SerialNumberscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#SerialNumber., s) |
| 175 | } else if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidCountryscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidCountry.) { |
| 176 | aux.Countryscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Country. = append(aux.Countryscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Country., s) |
| 177 | } else if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidLocalityscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidLocality.) { |
| 178 | aux.Localityscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Locality. = append(aux.Localityscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Locality., s) |
| 179 | } else if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidProvincescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidProvince.) { |
| 180 | aux.Provincescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Province. = append(aux.Provincescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Province., s) |
| 181 | } else if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidStreetAddressscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidStreetAddress.) { |
| 182 | aux.StreetAddressscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#StreetAddress. = append(aux.StreetAddressscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#StreetAddress., s) |
| 183 | } else if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidOrganizationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidOrganization.) { |
| 184 | aux.Organizationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Organization. = append(aux.Organizationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Organization., s) |
| 185 | } else if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidGivenNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidGivenName.) { |
| 186 | aux.GivenNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#GivenName. = append(aux.GivenNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#GivenName., s) |
| 187 | } else if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidOrganizationalUnitscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidOrganizationalUnit.) { |
| 188 | aux.OrganizationalUnitscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#OrganizationalUnit. = append(aux.OrganizationalUnitscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#OrganizationalUnit., s) |
| 189 | } else if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidPostalCodescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidPostalCode.) { |
| 190 | aux.PostalCodescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#PostalCode. = append(aux.PostalCodescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#PostalCode., s) |
| 191 | } else if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidDomainComponentscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidDomainComponent.) { |
| 192 | aux.DomainComponentscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#DomainComponent. = append(aux.DomainComponentscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#DomainComponent., s) |
| 193 | } else if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidDNEmailAddressscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidDNEmailAddress.) { |
| 194 | aux.EmailAddressscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#EmailAddress. = append(aux.EmailAddressscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#EmailAddress., s) |
| 195 | // EV |
| 196 | } else if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidJurisdictionCountryscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidJurisdictionCountry.) { |
| 197 | aux.JurisdictionCountryscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#JurisdictionCountry. = append(aux.JurisdictionCountryscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#JurisdictionCountry., s) |
| 198 | } else if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidJurisdictionLocalityscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidJurisdictionLocality.) { |
| 199 | aux.JurisdictionLocalityscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#JurisdictionLocality. = append(aux.JurisdictionLocalityscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#JurisdictionLocality., s) |
| 200 | } else if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidJurisdictionProvincescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidJurisdictionProvince.) { |
| 201 | aux.JurisdictionProvincescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#JurisdictionProvince. = append(aux.JurisdictionProvincescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#JurisdictionProvince., s) |
| 202 | } else if a.Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type..Equalscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#Equal().(oidOrganizationIDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidOrganizationID.) { |
| 203 | aux.OrganizationIDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#OrganizationID. = append(aux.OrganizationIDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#OrganizationID., s) |
| 204 | } else { |
| 205 | aux.UnknownAttributesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#UnknownAttributes. = append(aux.UnknownAttributesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#UnknownAttributes., a) |
| 206 | } |
| 207 | } |
| 208 | } |
| 209 | return jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/.Marshalscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/Marshal().(&aux) |
| 210 | } |
| 211 | |
| 212 | func appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(names []AttributeTypeAndValuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#, fieldVals []string, asn1Id asn1scip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/.ObjectIdentifierscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/encoding/asn1`/ObjectIdentifier#) []AttributeTypeAndValuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue# { |
| 213 | if len(fieldVals) == 0 { |
| 214 | return names |
| 215 | } |
| 216 | |
| 217 | for _, val := range fieldVals { |
| 218 | names = append(names, AttributeTypeAndValuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#{Typescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Type.: asn1Id, Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/AttributeTypeAndValue#Value.: val}) |
| 219 | } |
| 220 | |
| 221 | return names |
| 222 | } |
| 223 | |
| 224 | // UnmarshalJSON implements the json.Unmarshaler interface. |
| 225 | func (n *Namescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#) UnmarshalJSONscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#UnmarshalJSON().(b []byte) error { |
| 226 | aux := auxNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#{} |
| 227 | if err := jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/Unmarshal().(b, &aux); err != nil { |
| 228 | return err |
| 229 | } |
| 230 | |
| 231 | // Populate Names as []AttributeTypeAndValue |
| 232 | n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names. = appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names., aux.Countryscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Country., oidCountryscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidCountry.) |
| 233 | n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names. = appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names., aux.Organizationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Organization., oidOrganizationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidOrganization.) |
| 234 | n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names. = appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names., aux.OrganizationalUnitscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#OrganizationalUnit., oidOrganizationalUnitscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidOrganizationalUnit.) |
| 235 | n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names. = appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names., aux.Localityscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Locality., oidLocalityscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidLocality.) |
| 236 | n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names. = appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names., aux.Provincescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Province., oidProvincescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidProvince.) |
| 237 | n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names. = appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names., aux.StreetAddressscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#StreetAddress., oidStreetAddressscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidStreetAddress.) |
| 238 | n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names. = appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names., aux.PostalCodescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#PostalCode., oidPostalCodescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidPostalCode.) |
| 239 | n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names. = appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names., aux.DomainComponentscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#DomainComponent., oidDomainComponentscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidDomainComponent.) |
| 240 | n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names. = appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names., aux.EmailAddressscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#EmailAddress., oidDNEmailAddressscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidDNEmailAddress.) |
| 241 | // EV |
| 242 | n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names. = appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names., aux.JurisdictionCountryscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#JurisdictionCountry., oidJurisdictionCountryscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidJurisdictionCountry.) |
| 243 | n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names. = appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names., aux.JurisdictionLocalityscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#JurisdictionLocality., oidJurisdictionLocalityscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidJurisdictionLocality.) |
| 244 | n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names. = appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names., aux.JurisdictionProvincescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#JurisdictionProvince., oidJurisdictionProvincescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidJurisdictionProvince.) |
| 245 | |
| 246 | n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names. = appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names., aux.CommonNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#CommonName., oidCommonNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidCommonName.) |
| 247 | n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names. = appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(n.Namesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Names., aux.SerialNumberscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#SerialNumber., oidSerialNumberscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidSerialNumber.) |
| 248 | |
| 249 | // Populate specific fields as []string |
| 250 | n.Countryscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Country. = aux.Countryscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Country. |
| 251 | n.Organizationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Organization. = aux.Organizationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Organization. |
| 252 | n.OrganizationalUnitscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#OrganizationalUnit. = aux.OrganizationalUnitscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#OrganizationalUnit. |
| 253 | n.Localityscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Locality. = aux.Localityscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Locality. |
| 254 | n.Provincescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#Province. = aux.Provincescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#Province. |
| 255 | n.StreetAddressscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#StreetAddress. = aux.StreetAddressscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#StreetAddress. |
| 256 | n.PostalCodescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#PostalCode. = aux.PostalCodescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#PostalCode. |
| 257 | n.DomainComponentscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#DomainComponent. = aux.DomainComponentscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#DomainComponent. |
| 258 | // EV |
| 259 | n.JurisdictionCountryscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#JurisdictionCountry. = aux.JurisdictionCountryscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#JurisdictionCountry. |
| 260 | n.JurisdictionLocalityscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#JurisdictionLocality. = aux.JurisdictionLocalityscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#JurisdictionLocality. |
| 261 | n.JurisdictionProvincescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#JurisdictionProvince. = aux.JurisdictionProvincescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#JurisdictionProvince. |
| 262 | |
| 263 | // CommonName and SerialNumber are not arrays. |
| 264 | if len(aux.CommonNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#CommonName.) > 0 { |
| 265 | n.CommonNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#CommonName. = aux.CommonNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#CommonName.[0] |
| 266 | } |
| 267 | if len(aux.SerialNumberscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#SerialNumber.) > 0 { |
| 268 | n.SerialNumberscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#SerialNumber. = aux.SerialNumberscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#SerialNumber.[0] |
| 269 | } |
| 270 | |
| 271 | // Add "extra" commonNames and serialNumbers to ExtraNames. |
| 272 | if len(aux.CommonNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#CommonName.) > 1 { |
| 273 | n.ExtraNamesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#ExtraNames. = appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(n.ExtraNamesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#ExtraNames., aux.CommonNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#CommonName.[1:], oidCommonNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidCommonName.) |
| 274 | } |
| 275 | if len(aux.SerialNumberscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#SerialNumber.) > 1 { |
| 276 | n.ExtraNamesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#ExtraNames. = appendATVscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/appendATV().(n.ExtraNamesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/Name#ExtraNames., aux.SerialNumberscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/auxName#SerialNumber.[1:], oidSerialNumberscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/pkix`/oidSerialNumber.) |
| 277 | } |
| 278 | |
| 279 | return nil |
| 280 | } |