package fasthttp

import (
	
	
	
	
	
	
	
)

// GenerateTestCertificate generates a test certificate and private key based on the given host.
func ( string) ([]byte, []byte, error) {
	,  := rsa.GenerateKey(rand.Reader, 2048)
	if  != nil {
		return nil, nil, 
	}

	 := new(big.Int).Lsh(big.NewInt(1), 128)
	,  := rand.Int(rand.Reader, )
	if  != nil {
		return nil, nil, 
	}

	 := &x509.Certificate{
		SerialNumber: ,
		Subject: pkix.Name{
			Organization: []string{"fasthttp test"},
		},
		NotBefore:             time.Now(),
		NotAfter:              time.Now().Add(365 * 24 * time.Hour),
		KeyUsage:              x509.KeyUsageCertSign | x509.KeyUsageDigitalSignature,
		ExtKeyUsage:           []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth, x509.ExtKeyUsageClientAuth},
		SignatureAlgorithm:    x509.SHA256WithRSA,
		DNSNames:              []string{},
		BasicConstraintsValid: true,
		IsCA:                  true,
	}

	,  := x509.CreateCertificate(
		rand.Reader, , , &.PublicKey, ,
	)

	 := pem.EncodeToMemory(
		&pem.Block{
			Type:  "PRIVATE KEY",
			Bytes: x509.MarshalPKCS1PrivateKey(),
		},
	)

	 := pem.EncodeToMemory(
		&pem.Block{
			Type:  "CERTIFICATE",
			Bytes: ,
		},
	)

	return , , 
}