Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for readCACert (0.39 sec)

  1. security/pkg/k8s/chiron/utils_test.go

    	for _, tc := range testCases {
    		t.Run(tc.certPath, func(t *testing.T) {
    			cert, err := readCACert(tc.certPath)
    			if tc.shouldFail {
    				if err == nil {
    					t.Errorf("should have failed at readCACert()")
    				} else {
    					// Should fail, skip the current case.
    					return
    				}
    			} else if err != nil {
    				t.Errorf("failed at readCACert(): %v", err)
    			}
    
    			if !bytes.Equal(tc.expectedCert, cert) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 15 03:58:11 UTC 2024
    - 13K bytes
    - Viewed (0)
  2. security/pkg/k8s/chiron/utils.go

    		return nil, nil, err
    	}
    
    	// If there is a failure of cleaning up CSR, the error is returned.
    	return certChain, caCert, err
    }
    
    // Read CA certificate and check whether it is a valid certificate.
    func readCACert(caCertPath string) ([]byte, error) {
    	caCert, err := os.ReadFile(caCertPath)
    	if err != nil {
    		log.Errorf("failed to read CA cert, cert. path: %v, error: %v", caCertPath, err)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Apr 05 18:11:22 UTC 2024
    - 9.2K bytes
    - Viewed (0)
Back to top