Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for ParsePemEncodedCertificate (0.29 sec)

  1. tests/fuzz/security_fuzzer.go

    		return 0
    	}
    	// Check that certChainBytes can be parsed successfully
    	_, err = util.ParsePemEncodedCertificate(certChainBytes)
    	if err != nil {
    		return 0
    	}
    	rootCertBytes, err := f.GetBytes()
    	if err != nil {
    		return 0
    	}
    	// Check that rootCertBytes can be parsed successfully
    	_, err = util.ParsePemEncodedCertificate(rootCertBytes)
    	if err != nil {
    		return 0
    	}
    	signedCert, err := f.GetBytes()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Feb 28 16:41:38 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  2. security/pkg/pki/util/crypto.go

    	blockTypeRSAPrivateKey   = "RSA PRIVATE KEY" // PKCS#1 private key
    	blockTypePKCS8PrivateKey = "PRIVATE KEY"     // PKCS#8 plain private key
    )
    
    // ParsePemEncodedCertificate constructs a `x509.Certificate` object using the
    // given a PEM-encoded certificate.
    func ParsePemEncodedCertificate(certBytes []byte) (*x509.Certificate, error) {
    	cb, _ := pem.Decode(certBytes)
    	if cb == nil {
    		return nil, fmt.Errorf("invalid PEM encoded certificate")
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Jun 04 13:00:07 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  3. security/pkg/pki/util/keycertbundle.go

    	b.rootCertBytes = copyBytes(rootCertBytes)
    	// cert and privKey are always reset to point to new addresses. This avoids modifying the pointed structs that
    	// could be still used outside of the class.
    	b.cert, _ = ParsePemEncodedCertificate(certBytes)
    	privKey, _ := ParsePemEncodedKey(privKeyBytes)
    	b.privKey = &privKey
    	b.mutex.Unlock()
    }
    
    // CertOptions returns the certificate config based on currently stored cert.
    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/server/ca/server.go

    	if err != nil {
    		serverCaLog.Errorf("failed to extract root cert expiry timestamp (error %v)", err)
    	}
    	rootCertExpiryTimestamp.Record(rootCertExpiry)
    
    	rootCertPem, err := util.ParsePemEncodedCertificate(keyCertBundle.GetRootCertPem())
    	if err != nil {
    		serverCaLog.Errorf("failed to parse the root cert: %v", err)
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 28 17:35:26 UTC 2024
    - 8K bytes
    - Viewed (0)
  5. tests/integration/ambient/cacert_rotation_test.go

    		t.Errorf("failed to read %s file: %v", caCertFile, err)
    	}
    	return parseCert(t, certBytes)
    }
    
    func parseCert(t framework.TestContext, certBytes []byte) *x509.Certificate {
    	parsedCert, err := util.ParsePemEncodedCertificate(certBytes)
    	if err != nil {
    		t.Errorf("failed to parse certificate pem file: %v", err)
    	}
    	return parsedCert
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Apr 16 03:28:36 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  6. security/pkg/pki/util/crypto_test.go

    			pem:           certRSA,
    		},
    		"Parse ECDSA certificate": {
    			publicKeyAlgo: x509.ECDSA,
    			pem:           certECDSA,
    		},
    	}
    
    	for id, c := range testCases {
    		cert, err := ParsePemEncodedCertificate([]byte(c.pem))
    		if c.errMsg != "" {
    			if err == nil {
    				t.Errorf("%s: no error is returned", id)
    			} else if c.errMsg != err.Error() {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Jun 04 13:00:07 UTC 2024
    - 14.6K bytes
    - Viewed (0)
  7. security/pkg/pki/util/keycertbundle_test.go

    		IsSelfSigned: true,
    		TTL:          time.Hour,
    		RSAKeySize:   2048,
    	})
    	if err != nil {
    		t.Errorf("failed to gen root cert for Citadel self signed cert %v", err)
    	}
    
    	rootCert, err := ParsePemEncodedCertificate(rootCertBytes)
    	if err != nil {
    		t.Errorf("failed to parsing pem for root cert %v", err)
    	}
    
    	rootKey, err := ParsePemEncodedKey(rootKeyBytes)
    	if err != nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sun Jan 21 06:07:50 UTC 2024
    - 15.8K bytes
    - Viewed (0)
  8. pilot/pkg/bootstrap/server_test.go

    			}, retry.Timeout(10*time.Second))
    
    			close(stop)
    			if err != nil {
    				t.Fatalf("expect certRotated is %v while actual certRotated is %v", tt.certRotated, certRotated)
    			}
    			cert, certErr := util.ParsePemEncodedCertificate(rotatedCertBytes)
    			if certErr != nil {
    				t.Fatalf("rotated cert is not valid")
    			}
    			currTime := time.Now()
    			timeToExpire := cert.NotAfter.Sub(currTime)
    			if timeToExpire < 0 {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jun 13 17:48:28 UTC 2024
    - 23.1K bytes
    - Viewed (0)
Back to top