montross50/sshpubkey-validator

Validate ssh-rsa key for valid openssh format.

1.0.1 2022-02-23 20:09 UTC

This package is auto-updated.

Last update: 2024-03-24 00:35:07 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

This package serves to take in an ssh-rsa key and validate whether the key is in a valid format. I'm sure there is a better way to do this but I couldn't find anything better in pure php.

Install

Via Composer

$ composer require montross50/sshpubkey-validator

Usage

$validator = new montross50\SSHPubKeyValidator();
$key = "ssh-rsa .......";
if($validator->validateKey($key)){
    //key is valid
}
else{
    //key is invalid
}

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email sch43228@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.