PHP code example of luguohuakai / rsa

1. Go to this page and download the library: Download luguohuakai/rsa library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

luguohuakai / rsa example snippets


(new \Luguohuakai\Rsa\Rsa('private.pem','public.pem'))->encode('xxx');

(new \Luguohuakai\Rsa\Rsa('private.pem','public.pem'))->decode('xxx');

(new \Luguohuakai\Rsa\Rsa('private.pem','public.pem'))->sign('xxx');
(new \Luguohuakai\Rsa\Rsa('private.pem','public.pem'))->signPss('xxx');

(new \Luguohuakai\Rsa\Rsa('private.pem','public.pem'))->verify('xxx');
(new \Luguohuakai\Rsa\Rsa('private.pem','public.pem'))->verifyPss('xxx');