Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for ExtractIDs (0.21 sec)

  1. security/pkg/pki/ra/common.go

    	csr, err := util.ParsePemEncodedCSR(csrPEM)
    	if err != nil {
    		return false
    	}
    	if err := csr.CheckSignature(); err != nil {
    		return false
    	}
    	csrIDs, err := util.ExtractIDs(csr.Extensions)
    	if err != nil {
    		return false
    	}
    	for _, s1 := range csrIDs {
    		if !slices.Contains(subjectIDs, s1) {
    			return false
    		}
    	}
    	return true
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Sep 11 19:57:30 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  2. security/pkg/pki/util/san_test.go

    				{Id: asn1.ObjectIdentifier{1, 2, 3, 4}},
    				*sanExt,
    				{Id: asn1.ObjectIdentifier{3, 2, 1}},
    			},
    			expectedIDs: []string{id},
    		},
    	}
    
    	for id, tc := range testCases {
    		actualIDs, err := ExtractIDs(tc.exts)
    		if !reflect.DeepEqual(actualIDs, tc.expectedIDs) {
    			t.Errorf("Case %q: unexpected identities: want %v but got %v", id, tc.expectedIDs, actualIDs)
    		}
    		if tc.expectedErrMsg != "" {
    			if 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)
  3. security/pkg/pki/util/keycertbundle.go

    }
    
    // CertOptions returns the certificate config based on currently stored cert.
    func (b *KeyCertBundle) CertOptions() (*CertOptions, error) {
    	b.mutex.RLock()
    	defer b.mutex.RUnlock()
    	ids, err := ExtractIDs(b.cert.Extensions)
    	if err != nil {
    		return nil, fmt.Errorf("failed to extract id %v", err)
    	}
    	if len(ids) != 1 {
    		return nil, fmt.Errorf("expect single id from the cert, found %v", ids)
    	}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sun Jan 21 06:07:50 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  4. security/pkg/pki/util/generate_cert_test.go

    		}
    		if len(out.Subject.Organization) > 0 {
    			t.Errorf("Organization should be empty, but got %s", out.Subject.Organization)
    		}
    
    		ids, err := ExtractIDs(out.Extensions)
    		if err != nil {
    			t.Errorf("failed to extract IDs from cert extension: %v", err)
    		}
    		if len(c.subjectIDs) != len(ids) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Nov 06 12:48:53 UTC 2023
    - 29.4K bytes
    - Viewed (0)
Back to top