1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-14 18:15:39 +01:00

Merge branch '3.0'

This commit is contained in:
terrafrost 2021-04-18 22:21:25 -05:00
commit cdbc0308c3

View File

@ -115,6 +115,14 @@ abstract class AsymmetricKey
*/
protected static $engines = [];
/**
* Key Comment
*
* @var null|string
* @access private
*/
private $comment;
/**
* The constructor
*/
@ -173,8 +181,10 @@ abstract class AsymmetricKey
}
$components['format'] = $format;
$comment = isset($components['comment']) ? $components['comment'] : null;
$new = static::onLoad($components);
$new->format = $format;
$new->comment = $comment;
return $new instanceof PrivateKey ?
$new->withPassword($password) :
$new;
@ -425,6 +435,19 @@ abstract class AsymmetricKey
return $meta->getShortName();
}
/**
* Returns the key's comment
*
* Not all key formats support comments. If you want to set a comment use toString()
*
* @access public
* @return null|string
*/
public function getComment()
{
return $this->comment;
}
/**
* Tests engine validity
*