Create certificate with private key

Hello, i used appstoreconnect api to create certificate. api needs csrContent and i provided via openSSL:

openssl req -nodes -newkey rsa:2048 -keyout example.key -out example.csr -subj \"/C=GB/ST=London/L=London/O=Global Security/OU=IT Department/emailAddress=xx@xx.com\"

This command creates example.key(private key) and example.csr. In next step, i sent a request to api as csrContent: fs.readFileSync('example.csr') so certificed created successfuly. But when i download certificate and use it keychain got just certificate without private key. We need create certificate linked with key. If create csr via keychain no problem.

Replies

Maybe you can try

security import path/to/your/generated/private_key.key

or run

security help import

for more information.