CRT file does not contain a privatekey

SteveSims

I am preparing for a demo of a suite of apps on a private lan (not connected to anything but the machines involved). There is no DNS, so all URLs are based on IP address.

Because of the validations done on the ssl certs, the cert cannot be a self-signed cert. I have therefore used the following commands with openssl (for windows) to create a CA, and derived crt. I have successfully done this several years ago, and I think I ran into this issue before, but I cannot remember how I solved it. Nor can I find another post that solve the issue or reminds me what the solution was.

I am using the following commands:

openssl genrsa -des3 -out myCA.key 2048
openssl req -x509 -new -nodes -key myCA.key -sha256 -days 1825 -out myCA.pem
openssl genrsa -out derived.key 2048
openssl req -new -key derived.key -out derived.csr
openssl x509 -req -in derived.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial -out derived.crt -days 1825 -sha256 -extfile derived.ext


[derived.ext file contents]
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names

[alt_names]
DNS.1 = %%DOMAIN%%

The CA cert (myCA.PEM file] installs fine into the trusted roots folder. The derived.crt installs fine into the personal store, and validates properly with the CA. However, the derived.crt does not show a private key and cannot be used for SSL. Can anyone tell me what step I got wrong or am missing?

SteveSims

I seem to have solved the issue finally. Apparently a .crt file cannot contain a private key. Using the following command, I merged the .crt and key into a .pfx file, which imported and now shows a private key:

openssl pkcs12 -export -in derived.crt -inkey derived.key -out derived.pfx  

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

dex file does not contain MainActivity class

Get a PrivateKey from a RSA .pem file

Why does the pip requirements file contain "@file" instead of version number?

What is a .pid file and what does it contain?

What exactly does a jar file contain?

what is properties file? and what does it contain?

What Does "file does not contain class api.configuration" Mean?

the source attachment does not contain the source for the file Throwables.class

Convert .crt file to .cer and .key

Why does my jar file not not contain any class files?

Java Error: bad source file: file does not contain class

Find file that does not contain specific string

When and why does a *.xlsx File contain a *.bin file?

Does a blob contain the current status a file or only the last change?

Why does the bash translation file not contain all error texts?

Seahorse, PGP: What does the exported .pgp-file contain?

generated jar file does not contain $1 class file

Why does .cer file public key not contain RSA Exponent?

Files uploaded onto web server does not contain actual file data

What Type Of Data does the Input File Contain?

.KEY and .CSR files but no .CRT file

Does .pbix file also contain data?

'PrivateKey' does not have a definition for 'CreateFromFile'

FileNotFoundException on .crt file

json file does not contain valid JSON

Certificate file ldap-server.crt does not exist

Keyset does not exist although the PrivateKey is set

bash; content of the file does not contain more than

Does jar file not contain imported packages and classes?