Skip to content

Commit

Permalink
Implement getPublicKeyFromPrivateKey for PECL driver
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Apr 9, 2015
1 parent 6576bca commit 25c2af2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
13 changes: 13 additions & 0 deletions framework/Crypt/lib/Horde/Crypt/Pgp/Backend/Pecl.php
Expand Up @@ -74,4 +74,17 @@ public function getFingerprintsFromKey($pgpdata)
return $out;
}

/**
*/
public function getPublicKeyFromPrivateKey($data)
{
$gpg = new gnupg();

if (($info = $gpg->import($data)) === false) {
throw new RuntimeException();
}

return $gpg->export($info['fingerprint']);
}

}
5 changes: 0 additions & 5 deletions framework/Crypt/test/Horde/Crypt/Pgp/PeclTest.php
Expand Up @@ -97,9 +97,4 @@ public function testVerifyPassphrase()
$this->markTestIncomplete();
}

public function testGetPublicKeyFromPrivateKey()
{
$this->markTestIncomplete();
}

}

0 comments on commit 25c2af2

Please sign in to comment.