Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ExtractIDsFromSAN (0.55 sec)

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

    	return &pkix.Extension{Id: oidSubjectAlternativeName, Critical: true, Value: bs}, nil
    }
    
    // ExtractIDsFromSAN takes a SAN extension and extracts the identities.
    // The logic is mostly borrowed from
    // https://github.com/golang/go/blob/master/src/crypto/x509/x509.go, with the
    // addition of supporting extracting URIs.
    func ExtractIDsFromSAN(sanExt *pkix.Extension) ([]Identity, error) {
    	if !sanExt.Id.Equal(oidSubjectAlternativeName) {
    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/san_test.go

    	}
    
    	for id, tc := range testCases {
    		if _, err := ExtractIDsFromSAN(tc.ext); err == nil {
    			t.Errorf("%v: Expecting error to be returned but got nil", id)
    		}
    	}
    }
    
    func TestExtractIDsFromSANWithBadEncoding(t *testing.T) {
    	ext := &pkix.Extension{
    		Id:    oidSubjectAlternativeName,
    		Value: []byte("bad value"),
    	}
    
    	if _, err := ExtractIDsFromSAN(ext); err == nil {
    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