S
S
Sanzhar_I2015-06-09 11:52:59
PHP
Sanzhar_I, 2015-06-09 11:52:59

How to convert .rsa to .pem and vice versa using php?

Hi all!
I ran this command using OpenSsl.exe on windows:
$ openssl pkcs12 -in 529763127606.p12 -nocerts -nodes -out 529763127606.key
Enter Import Password:
MAC verified OK
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
I want to automate that the same for php , any options?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Burov, 2015-06-09
@BuriK666

OpenSSL

K
Kir ---, 2015-06-09
@SowingSadness

In general, data signed according to the pkcs12 specification can be stored in PEM format.
What is .rsa is not known. There is an RSA encryption algorithm. So, according to the pkcs12 specification, they can sign documents using this algorithm.
In your case, based on the openssl command, you simply get the content (-nocerts) from the signed document and for some reason call it xxxx.key
In general, PHP has functions for working with OpenSSL. Or you can call the necessary commands through shell_exec.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question