Carregando...
 

Converter certificado em pfx

Quando o cliente fornecer um certificado no formato pfx, podemos utilizar o openssl para converter o mesmo em um formato que possibilita a instalação no apache.  Basta seguir os passos abaixo:  Baixar o arquivo pfx para seu computador, uma vez realizado o download vamos iniciar o procedimento de conversão: (Digamos que o arquivo esteja na área de trabalho e o nome seja Certificado-Tech-2016.pfx) /home/marco/Área de Trabalho

1: Gerar arquivo do certificado
$ openssl pkcs12 -in Certificado-Tech-2016.pfx -clcerts -nokeys -out tech.cer 
Enter Import Password: 
MAC verified OK

 

2: Extrair a key
$ openssl pkcs12 -in Certificado-Tech-2016.pfx -nocerts -nodes  -out tech_encrypted.key  
Enter Import Password: 
MAC verified OK

 

3: Descriptografar a key para utilizar com o Apache
$ openssl rsa -in tech_encrypted.key -out tech.key 
writing RSA key

 

E pronto, o certificado já pode ser instalado no Apache:
$ cat tech.cer  
Bag Attributes 
   localKeyID: 01 00 00 00  
   friendlyName: Certifica-Tech-Wild2016 
subject=/OU=Domain Control Validated/CN=*.techevo.com.br 
issuer=/C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2 
-----BEGIN CERTIFICATE----- 
MIIHVjCCBj6gAwIBAgIMSG0cgU/pKUD0XkL/MA0GCSqGSIb3DQEBCwUAMEwxCzAJ 
BgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMSIwIAYDVQQDExlB 
bHBoYVNTTCBDQSAtIFNIQTI1NiAtIEcyMB4XDTE2MDkwNTE1MzIwMloXDTE4MDkw 
NDEzNTA0M1owPjEhMB8GA1UECxMYRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkMRkw 
FwYDVQQDDBAqLnRlY2hldm8uY29tLmJyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A 
MIIBCgKCAQEArdOaI7mxfazaGV5OPzBZcE87Gu/L3wu9g7atIVTcCsQ6Jw6jgrQS 
cImVKK1ySP60BLZxC6mPBj9pxIQiQWTZfE4yMYIdOG/0anBe3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0oj3mm3aRm 
K/PmAKLSvy1aaOVBRHXSwSGg0IN9+xk+LFex1F8JbV3y6lKsWh2I2bQnVWWC7mrC 
erimyqUIJwJyEd7yEk8FpWkEn2pSb44NCeZ3aK0CgYEA1mmSbRA7rzjcM6anE1Ut 
jFJXEvkW8MG4dHvKV8pIg7a99NITb7Rgv35yAlkQYa8CLaVjvFN9eJOzxdDLmmiB 
+ihwU3PJdrHOr515E5oHy0LliYOI52qE1bAuO3ZHtRCU4hvGZBb5LwPk3rCOYKkt 
cmptSfSHYq4CyqppyOjrt5MCgYAZ3iXM5mgdxUOTtxVINlkqEh6sAI8JZp4b4X8x 
zBBywFBKTnL7CmqtsppNFM5/KxPCHeuzj+9lVBo5TbarNOHKNThPca42+bWPisSv 
vCBppuaqvwXMtH+3IkEoZWXwG4gPDJ+C7pBvHx0VcXg4LdSOYEqhjV0j4zjhK8NC 
9F/9vQKBgCPvpp+VQNn5AkIahMcJi0BmmIbcWNcCfoMYb2okctmER60IeLEn+E1r 
0lHwEZSafig1E/b4mVdM2UUXpiEOfQOZ0cUT7bAgfCVRZ4nL3ecc1Lm1BMn5PxjM 
S2OrfpmYIS2KdZgyMt7HydMIgItNbMmgSwRqGJI57WfbsFHTj2UJ 
-----END RSA PRIVATE KEY-----

 

Contribuíram para esta página: Leonardo Peixoto .
Última modificação da página em Quinta-feira Junho 1, 2017 10:33:47 -03 por Leonardo Peixoto. (Versão 1)
Page approved by Leonardo Peixoto on Quinta-feira Junho 1, 2017 10:33:51 -03