Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for rootCertPem (0.32 sec)

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

    )
    
    func TestVerifyCert(t *testing.T) {
    	testCases := map[string]struct {
    		privPem        []byte
    		certChainPem   []byte
    		rootCertPem    []byte
    		expectedFields *VerifyFields
    		expectedErr    string
    	}{
    		"Root cert bad": {
    			privPem:        nil,
    			certChainPem:   nil,
    			rootCertPem:    []byte(rootCertBad),
    			expectedFields: verifyField1,
    			expectedErr:    "failed to parse root certificate",
    		},
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Aug 16 14:56:37 UTC 2022
    - 6.5K bytes
    - Viewed (0)
  2. security/pkg/pki/util/verify_cert.go

    // - checking fields are set as expected.
    func VerifyCertificate(privPem []byte, certChainPem []byte, rootCertPem []byte, expectedFields *VerifyFields) error {
    	roots := x509.NewCertPool()
    	if rootCertPem != nil {
    		if ok := roots.AppendCertsFromPEM(rootCertPem); !ok {
    			return fmt.Errorf("failed to parse root certificate")
    		}
    	}
    
    	intermediates := x509.NewCertPool()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Sep 05 10:37:29 UTC 2022
    - 5.9K bytes
    - Viewed (0)
  3. tests/fuzz/pki_fuzzer.go

    		return 0
    	}
    	certChainPem, err := f.GetBytes()
    	if err != nil {
    		return 0
    	}
    	rootCertPem, err := f.GetBytes()
    	if err != nil {
    		return 0
    	}
    	expectedFields := &util.VerifyFields{}
    	err = f.GenerateStruct(expectedFields)
    	if err != nil {
    		return 0
    	}
    	util.VerifyCertificate(privPem, certChainPem, rootCertPem, expectedFields)
    	return 1
    }
    
    // FindRootCertFromCertificateChainBytesFuzz implements a fuzzer
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jun 05 14:00:25 UTC 2023
    - 5.2K bytes
    - Viewed (0)
  4. security/pkg/pki/ra/k8s_ra_test.go

    			if tc.rootCertForMeshConfig != "" {
    				rootCertPem, err := os.ReadFile(tc.rootCertForMeshConfig)
    				if err != nil {
    					t.Errorf("Failed to read sample %s", tc.rootCertForMeshConfig)
    				}
    				caCertificates := []*meshconfig.MeshConfig_CertificateData{
    					{CertificateData: &meshconfig.MeshConfig_CertificateData_Pem{Pem: string(rootCertPem)}, CertSigners: []string{signer}},
    				}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Sep 27 00:44:54 UTC 2023
    - 9.7K bytes
    - Viewed (0)
  5. security/pkg/server/ca/server.go

    	}
    	rootCertExpiryTimestamp.Record(rootCertExpiry)
    
    	rootCertPem, err := util.ParsePemEncodedCertificate(keyCertBundle.GetRootCertPem())
    	if err != nil {
    		serverCaLog.Errorf("failed to parse the root cert: %v", err)
    	}
    	rootCertExpirySeconds.ValueFrom(func() float64 { return time.Until(rootCertPem.NotAfter).Seconds() })
    
    	if len(keyCertBundle.GetCertChainPem()) == 0 {
    		return
    	}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 28 17:35:26 UTC 2024
    - 8K bytes
    - Viewed (0)
  6. security/pkg/nodeagent/cache/secretcache.go

    	if len(trustBundlePEM) > 0 {
    		rootCertPEM = concatCerts(trustBundlePEM)
    	} else {
    		// If CA Client has no explicit mechanism to retrieve CA root, infer it from the root of the certChain
    		rootCertPEM = []byte(certChainPEM[len(certChainPEM)-1])
    	}
    
    	return &security.SecretItem{
    		CertificateChain: certChain,
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Mar 04 08:29:46 UTC 2024
    - 28.2K bytes
    - Viewed (0)
  7. security/pkg/pki/ca/ca_test.go

    	}
    
    	if !signingCertFromSecret.Equal(signingCert) {
    		t.Error("CA signing cert does not match the K8s secret")
    	}
    }
    
    func TestCreateSelfSignedIstioCAWithSecret(t *testing.T) {
    	rootCertPem := cert1Pem
    	// Use the same signing cert and root cert for self-signed CA.
    	signingCertPem := []byte(cert1Pem)
    	signingKeyPem := []byte(key1Pem)
    
    	client := fake.NewSimpleClientset()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Oct 31 08:51:27 UTC 2023
    - 29.1K bytes
    - Viewed (0)
Back to top