- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for ParsePemEncodedCertificate (0.31 sec)
-
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) -
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) -
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)