...
Блок кода |
---|
language | ruby |
---|
linenumbers | false |
---|
|
keytool -keystore .keystore -alias mps -importcert -file mps.pem |
2.1. Если нам нужно самим создать сертификат:
Генерируем ключ, osmp.key - в данном случае имя файла, здесь уже нужно использовать другой пароль, потому что его необходимо будет также переслать удаленной стороне:
...
Блок кода |
---|
language | java |
---|
linenumbers | false |
---|
|
[amir@ts01 keys]$ openssl req -new -key osmp.key -out osmp.csr
Enter pass phrase for osmp.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:RU
State or Province Name (full name) [Berkshire]:.
Locality Name (eg, city) [Newbury]:.
Organization Name (eg, company) [My Company Ltd]:OSMP
Organizational Unit Name (eg, section) []:OSMP-BGBilling
Common Name (eg, your name or your server's hostname) []:www.osmp.ru
Email Address []:support@osmp.ru
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []: |
...
2.2. Если нам прислали CSR-запрос на подпись или мы только что сами создали новый, создаем подписанный сертификат из запроса:
Блок кода |
---|
language | java |
---|
linenumbers | false |
---|
|
[amir@ts01 keys]$ openssl x509 -req -in osmp.csr -CA mps.pem -CAkey mps.key -out osmp.pem -days 1001 -CAcreateserial -CAserial mps.seq
Signature ok
subject=/C=RU/O=OSMP/OU=OSMP-BGBilling/CN=www.osmp.ru/emailAddress=support@osmp.ru
Getting CA Private Key
Enter pass phrase for mps.key: |
...