- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 15 for ParsePemEncodedCertificate (0.31 sec)
-
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) -
security/pkg/pki/ca/ca_test.go
keyPEM, append(certPEM, certChainBytes...), rootCertBytes, &tc.verifyFields); err != nil { t.Errorf("%s: VerifyCertificate error: %v", id, err) } cert, err := util.ParsePemEncodedCertificate(certPEM) if err != nil { t.Errorf("%s: ParsePemEncodedCertificate error: %v", id, err) } if ttl := cert.NotAfter.Sub(cert.NotBefore) - util.ClockSkewGracePeriod; ttl != tc.requestedTTL {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Tue Oct 31 08:51:27 UTC 2023 - 29.1K bytes - Viewed (0) -
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/verify_cert.go
} } intermediates := x509.NewCertPool() if ok := intermediates.AppendCertsFromPEM(certChainPem); !ok { return fmt.Errorf("failed to parse certificate chain") } cert, err := ParsePemEncodedCertificate(certChainPem) if err != nil { return err } opts := x509.VerifyOptions{ Intermediates: intermediates, Roots: roots, } host := "" if expectedFields != nil {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Mon Sep 05 10:37:29 UTC 2022 - 5.9K bytes - Viewed (0) -
security/pkg/util/certutil.go
// grace period. func (cu CertUtilImpl) GetWaitTime(certBytes []byte, now time.Time) (time.Duration, error) { cert, certErr := util.ParsePemEncodedCertificate(certBytes) if certErr != nil { return time.Duration(0), certErr } timeToExpire := cert.NotAfter.Sub(now) if timeToExpire < 0 {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Thu Nov 30 19:33:26 UTC 2023 - 2.3K bytes - Viewed (0) -
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) -
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) -
security/pkg/pki/util/generate_cert_test.go
t.Fatal(err) } if VerifyCertificate(ecCaPrivPem, ecCaCertPem, ecCaCertPem, fields) != nil { t.Fatal(err) } rsaCaCert, err := ParsePemEncodedCertificate(rsaCaCertPem) if err != nil { t.Fatal(err) } ecCaCert, err := ParsePemEncodedCertificate(ecCaCertPem) if err != nil { t.Fatal(err) } rsaCaPriv, err := ParsePemEncodedKey(rsaCaPrivPem) if err != nil { t.Fatal(err) }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Mon Nov 06 12:48:53 UTC 2023 - 29.4K bytes - Viewed (0) -
security/pkg/pki/ca/selfsignedcarootcertrotator_test.go
if oldKeyLen != newKeyLen { t.Errorf("Public key size should not change, (got %d) vs (expected %d)", newKeyLen, oldKeyLen) } oldRootCert, _ := util.ParsePemEncodedCertificate(oldCertItem.caSecret.Data[CACertFile]) newRootCert, _ := util.ParsePemEncodedCertificate(newCertItem.caSecret.Data[CACertFile]) if oldRootCert.Subject.String() != newRootCert.Subject.String() { t.Errorf("certificate Subject does not match (old: %s) vs (new: %s)",
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Wed Oct 11 23:33:41 UTC 2023 - 14.1K bytes - Viewed (0) -
security/pkg/pki/util/generate_cert.go
// genCertTemplateFromOptions(), and only called by a self-signed Citadel. func GetCertOptionsFromExistingCert(certBytes []byte) (opts CertOptions, err error) { cert, certErr := ParsePemEncodedCertificate(certBytes) if certErr != nil { return opts, certErr } orgs := cert.Subject.Organization if len(orgs) > 0 { opts.Org = orgs[0] }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Wed Aug 02 14:34:38 UTC 2023 - 14.2K bytes - Viewed (0)