// GenerateCSR creates a X.509 certificate sign request and private key.
GenerateCSR creates a X.509 certificate sign request and private key.
// GenerateCSR creates a X . 509 certificate sign request and private key .
func GenerateCSR(org string, pkcs8 bool) ([]byte, []byte, error) {
	key, err := certs.GenerateECPrivateKey()
	if err != nil {
		return nil, nil, fmt.Errorf("unable to generate private keys: %s", err)
	}
	templ, err := genCSRTemplate(org)
	if err != nil {
		return nil, nil, fmt.Errorf("error generating csr template: %s", err)
	}
	csrBytes, err := x509.CreateCertificateRequest(rand.Reader, templ, crypto.PrivateKey(key))
	if err != nil {
		return nil, nil, fmt.Errorf("failed to create CSR: %s", err)
	}
	crtPem, keyPem, err := encode(true, csrBytes, key, pkcs8)
	return crtPem, keyPem, err
}
func GenerateCSR ( org string , pkcs8 bool ) ( [ ] byte , [ ] byte , error ) { key , err := certs . GenerateECPrivateKey ( ) if err != nil { return nil , nil , fmt . Errorf ( " " , err ) } templ , err := genCSRTemplate ( org ) if err != nil { return nil , nil , fmt . Errorf ( " " , err ) } csrBytes , err := x509 . CreateCertificateRequest ( rand . Reader , templ , crypto . PrivateKey ( key ) ) if err != nil { return nil , nil , fmt . Errorf ( " " , err ) } crtPem , keyPem , err := encode ( true , csrBytes , key , pkcs8 ) return crtPem , keyPem , err }
GenerateCSR creates a X.509 certificate sign request and private key.
GenerateCSR creates a X . 509 certificate sign request and private key .