I'm trying to check signatures of a PGP public key on PHP with GnuPG extension.
After importing the key with $gpg->import($key)
, I'm running $gpg->keyinfo('')
and that's the result;
[0] => Array
(
[disabled] =>
[expired] =>
[revoked] =>
[is_secret] =>
[can_sign] => 1
[can_encrypt] => 1
[uids] => Array
(
[0] => Array
(
[name] => test
[comment] =>
[email] => test@test.com
[uid] => test <test@test.com>
[revoked] =>
[invalid] =>
)
)
[subkeys] => Array
(
[0] => Array
(
[fingerprint] => 123456123456123456123456123456123456
[keyid] => 123456
[timestamp] => 1518600000
[expires] => 0
[is_secret] =>
[invalid] =>
[can_encrypt] =>
[can_sign] => 1
[disabled] =>
[expired] =>
[revoked] =>
)
[1] => Array
(
[fingerprint] => 345678345678345678345678345678345678345678
[keyid] => 141231231313
[timestamp] => 1518600000
[expires] => 0
[is_secret] =>
[invalid] =>
[can_encrypt] => 1
[can_sign] =>
[disabled] =>
[expired] =>
[revoked] =>
)
)
)
Unfortunately it doesn't have the signatures. I also tried verifySignature
function but it says "no signatures found". How can I get signatures of a public key with PHP? Is it okay if I use exec
to run gpg
and parse the output?