Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for parseCertificateRequest (0.55 sec)

  1. pkg/apis/certificates/v1/helpers.go

    	block, _ := pem.Decode(pemBytes)
    	if block == nil || block.Type != "CERTIFICATE REQUEST" {
    		return nil, errors.New("PEM block type must be CERTIFICATE REQUEST")
    	}
    	csr, err := x509.ParseCertificateRequest(block.Bytes)
    	if err != nil {
    		return nil, err
    	}
    	return csr, nil
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 05 04:47:24 UTC 2020
    - 1K bytes
    - Viewed (0)
  2. pkg/apis/certificates/v1beta1/helpers.go

    	block, _ := pem.Decode(pemBytes)
    	if block == nil || block.Type != "CERTIFICATE REQUEST" {
    		return nil, errors.New("PEM block type must be CERTIFICATE REQUEST")
    	}
    	csr, err := x509.ParseCertificateRequest(block.Bytes)
    	if err != nil {
    		return nil, err
    	}
    	return csr, nil
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Feb 27 10:17:55 UTC 2020
    - 1K bytes
    - Viewed (0)
  3. pkg/controller/certificates/authority/authority.go

    // Sign signs a certificate request, applying a SigningPolicy and returns a DER
    // encoded x509 certificate.
    func (ca *CertificateAuthority) Sign(crDER []byte, policy SigningPolicy) ([]byte, error) {
    	cr, err := x509.ParseCertificateRequest(crDER)
    	if err != nil {
    		return nil, fmt.Errorf("unable to parse certificate request: %v", err)
    	}
    	if err := cr.CheckSignature(); err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 23 19:36:11 UTC 2021
    - 2.5K bytes
    - Viewed (0)
  4. security/pkg/pki/util/generate_csr_test.go

    			} else {
    				t.Errorf("%s: failed to gen CSR", id)
    			}
    		}
    
    		pemBlock, _ := pem.Decode(csrPem)
    		if pemBlock == nil {
    			t.Fatalf("%s: failed to decode csr", id)
    		}
    		csr, err := x509.ParseCertificateRequest(pemBlock.Bytes)
    		if err != nil {
    			t.Fatalf("%s: failed to parse csr", id)
    		}
    		if err = csr.CheckSignature(); err != nil {
    			t.Errorf("%s: csr signature is invalid", id)
    		}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Feb 25 09:40:13 UTC 2022
    - 5.5K bytes
    - Viewed (0)
  5. pkg/test/csrctrl/authority/authority.go

    		now = ca.Now()
    	}
    
    	nbf := now.Add(-ca.Backdate)
    	if !nbf.Before(ca.Certificate.NotAfter) {
    		return nil, fmt.Errorf("the signer has expired: NotAfter=%v", ca.Certificate.NotAfter)
    	}
    
    	cr, err := x509.ParseCertificateRequest(crDER)
    	if err != nil {
    		return nil, fmt.Errorf("unable to parse certificate request: %v", err)
    	}
    	if err := cr.CheckSignature(); err != nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Jul 28 18:22:37 UTC 2021
    - 3K bytes
    - Viewed (0)
  6. pkg/apis/certificates/helpers.go

    	block, _ := pem.Decode(pemBytes)
    	if block == nil || block.Type != "CERTIFICATE REQUEST" {
    		return nil, errors.New("PEM block type must be CERTIFICATE REQUEST")
    	}
    	csr, err := x509.ParseCertificateRequest(block.Bytes)
    	if err != nil {
    		return nil, err
    	}
    	return csr, nil
    }
    
    var (
    	organizationNotSystemNodesErr = fmt.Errorf("subject organization is not system:nodes")
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Dec 27 08:04:25 UTC 2022
    - 4K bytes
    - Viewed (0)
  7. security/pkg/pki/util/crypto.go

    	block, _ := pem.Decode(csrBytes)
    	if block == nil {
    		return nil, fmt.Errorf("certificate signing request is not properly encoded")
    	}
    	csr, err := x509.ParseCertificateRequest(block.Bytes)
    	if err != nil {
    		return nil, fmt.Errorf("failed to parse X.509 certificate signing request")
    	}
    	return csr, nil
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Jun 04 13:00:07 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  8. src/crypto/x509/x509.go

    		SignatureAlgorithm: algorithmIdentifier,
    		SignatureValue:     asn1.BitString{Bytes: signature, BitLength: len(signature) * 8},
    	})
    }
    
    // ParseCertificateRequest parses a single certificate request from the
    // given ASN.1 DER data.
    func ParseCertificateRequest(asn1Data []byte) (*CertificateRequest, error) {
    	var csr certificateRequest
    
    	rest, err := asn1.Unmarshal(asn1Data, &csr)
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 09:20:15 UTC 2024
    - 82K bytes
    - Viewed (0)
  9. cmd/kubeadm/app/util/pkiutil/pki_helpers.go

    	}
    
    	if block.Type != certutil.CertificateRequestBlockType {
    		return nil, errors.Errorf("expected block type %q, but PEM had type %q", certutil.CertificateRequestBlockType, block.Type)
    	}
    
    	return x509.ParseCertificateRequest(block.Bytes)
    }
    
    // CertificateRequestFromFile returns the CertificateRequest from a given PEM-encoded file.
    // Returns an error if the file could not be read or if the CSR could not be parsed.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 01 16:01:49 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  10. src/crypto/x509/x509_test.go

    func TestDuplicateExtensionsCSR(t *testing.T) {
    	b, _ := pem.Decode([]byte(dupExtCSR))
    	if b == nil {
    		t.Fatalf("couldn't decode test CSR")
    	}
    	_, err := ParseCertificateRequest(b.Bytes)
    	if err == nil {
    		t.Fatal("ParseCertificateRequest should fail when parsing CSR with duplicate extensions")
    	}
    }
    
    const dupAttCSR = `-----BEGIN CERTIFICATE REQUEST-----
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:00:16 UTC 2024
    - 163.4K bytes
    - Viewed (0)
Back to top