Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for readCACert (0.09 sec)

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

    		if err != nil {
    			return
    		}
    		defer func() {
    			caFile.Close()
    			os.Remove("caFile")
    		}()
    		_, err = caFile.Write(caCert)
    		if err != nil {
    			return
    		}
    
    		// call readCACert()
    		_, _ = readCACert("caFile")
    	})
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Oct 12 14:51:41 UTC 2022
    - 988 bytes
    - Viewed (0)
  2. 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)
  3. 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