2023-03-25 15:06:58 -05:00

16 lines
251 B
Go

package certificate
import (
"crypto/rand"
"crypto/rsa"
)
func CreateRSAKeyPair(bytes int) (*rsa.PrivateKey, error) {
keyPair, err := rsa.GenerateKey(rand.Reader, bytes)
if err != nil {
return &rsa.PrivateKey{}, err
}
return keyPair, nil
}