0
和私鑰我有例子,如何簽署JWT鍵與私鑰,然後在PHP智威湯遜簽署與PHP
它與公衆一個解碼$privKey = openssl_pkey_new(array('digest_alg' => 'sha256',
'private_key_bits' => 1024,
'private_key_type' => OPENSSL_KEYTYPE_RSA));
$msg = JWT::encode('abc', $privKey, 'RS256');
$pubKey = openssl_pkey_get_details($privKey);
$pubKey = $pubKey['key'];
$decoded = JWT::decode($msg, $pubKey, array('RS256'));
$this->assertEquals($decoded, 'abc');
,但在這裏產生,然後使用所產生的飛行關鍵,如果我需要使用已經生成的私鑰和公鑰,該怎麼辦?是否可以/足夠使用file_get_contents
?
更新
我發現openssl_pkey_get_private和openssl_pkey_get_public我會嘗試使用此代碼使用它們。