Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for BuildSubjectAltNameExtension (0.37 sec)

  1. security/pkg/pki/util/san.go

    // the type of the identity.
    type Identity struct {
    	Type  IdentityType
    	Value []byte
    }
    
    // BuildSubjectAltNameExtension builds the SAN extension for the certificate.
    func BuildSubjectAltNameExtension(hosts string) (*pkix.Extension, error) {
    	ids := []Identity{}
    	for _, host := range strings.Split(hosts, ",") {
    		if ipa, _ := netip.ParseAddr(host); ipa.IsValid() {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Oct 14 06:50:22 UTC 2022
    - 6K bytes
    - Viewed (0)
  2. security/pkg/pki/util/generate_csr.go

    	template := &x509.CertificateRequest{
    		Subject: pkix.Name{
    			Organization: []string{options.Org},
    		},
    	}
    
    	if h := options.Host; len(h) > 0 {
    		s, err := BuildSubjectAltNameExtension(h)
    		if err != nil {
    			return nil, err
    		}
    		if options.IsDualUse {
    			cn, err := DualUseCommonName(h)
    			if err != nil {
    				// log and continue
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Nov 06 12:48:53 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  3. security/pkg/pki/util/san_test.go

    			expectedExt: getSANExtension([]Identity{uriIdentity, ipIdentity, dnsIdentity}, t),
    		},
    	}
    
    	for id, tc := range testCases {
    		if ext, err := BuildSubjectAltNameExtension(tc.hosts); err != nil {
    			t.Errorf("Case %q: a unexpected error has been encountered (error: %v)", id, err)
    		} else if !reflect.DeepEqual(ext, tc.expectedExt) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Feb 12 17:36:33 UTC 2024
    - 6.5K bytes
    - Viewed (0)
Back to top