It's actually "file://key.pem" when you want to give a relative path using unix systems. It will be three '/' in case of absolute path (e.g "file:///home/username/..."). But this path consists of two '/' originated from "file://" and one '/' from the fact that home is a subfolder of the unix filesystem's root directory ("/home/username/..."). This two part will be concatenated and you will get three '/' characters following each other.
So you only have to concatenate "file://" with an existing path string in every case.openssl_pkey_get_private
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
openssl_pkey_get_private
Референца за `function.openssl-pkey-get-private.php` со подобрена типографија и навигација.
openssl_pkey_get_private
(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
openssl_pkey_get_private — Земи приватен клуч
= NULL
$private_key, #[\SensitiveParameter]?string $passphrase = null): OpenSSLAsymmetricKey|false
openssl_pkey_get_private() parses
private_key и го подготвува за употреба од други функции.
Параметри
private_key-
private_keyможе да биде една од следниве:низ што го има форматот file://path/to/file.pem. Именуваната датотека мора да содржи PEM кодиран сертификат/приватен клуч (може да содржи и двете).
А PEM форматиран приватен клуч.
passphrase-
Изборниот параметар
passphraseмора да се користи ако наведениот клуч е шифриран (заштитен со лозинка).
Вратени вредности
Враќа OpenSSLAsymmetricKey инстанца при успех, или false при грешка.
Дневник на промени
| Верзија | = NULL |
|---|---|
| 8.0.0 |
При успех, оваа функција враќа OpenSSLAsymmetricKey инстанца сега; претходно, а resource од тип OpenSSL key .
|
| 8.0.0 |
private_key прифаќа OpenSSLAsymmetricKey
or OpenSSLCertificate инстанца сега; претходно, а resource од тип OpenSSL key or OpenSSL X.509
беше прифатено.
|
| 8.0.0 |
passphrase сега е null.
|