phpseclib/phpseclib — pull request #101 by johnsterling (2013-05-05 21:55:22+00:00)
Title: Add support for custom RSA key comments.

The comment field of OpenSSH public keys can be useful for identifier information when programmatically managing keys. Rather than doing a string replace of "phpseclib-generated-key" it would be handy to be able to set the comment using `Crypt_RSA` directly.

Example usage:
```php
setPublicKeyFormat(CRYPT_RSA_PUBLIC_FORMAT_OPENSSH);

$rsa->setComment('This is my comment');

extract($rsa->createKey());

// ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUpwmJG8wVQZKjeGcjDOL5UlsuusFncCzWBQ7RKNUSesmQRMSGkVb1/3j+skZ6UtW+5u09lHNsj6tQ51s1SPrCBkedbNf0Tp0GbMJDyR4e9T04ZZw== This is my comment
file_put_contents('.ssh/authorized_keys', $publickey."\n", FILE_APPEND);
```

Also, when using `loadKey()` the comment should now be parsed:
```php
loadKey($line);

// "This is my comment" from last line after previous example
echo $rsa->comment;
}
```

Comments should also be written/read when using `CRYPT_RSA_PRIVATE_FORMAT_PUTTY`, which is the only other format I saw that was using them.