2

How can I use below vendor library in my custom module's helper file? I want to create an object of this class.

/magento2/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php

I have tried with below in my helper file but not working.

use phpseclib\phpseclib\phpseclib\Crypt\RSA;

Also I tried to add using composer but still its not working.

{
"name": "company/module",
"description": "N/A",
"require": {
    "php": "~5.6.0|7.0.2|~7.0.6",
    "magento/magento-composer-installer": "*",
    "phpseclib/phpseclib":"*"
},
"type": "magento2-module",
"version": "2.0.0",
"license": [
    "proprietary"
],
"autoload": {
    "files": [
        "registration.php"
    ],
    "psr-4": {
        "Company\\Module\\": ""
    }
}

}

1 Answer 1

1

Try following way:

use \phpseclib\Crypt\RSA;

How to use:

$rsa = new RSA();
echo '<pre>';print_r($rsa->createKey(1024));
1
  • Hello, Could you please let us know how can we call below class? Minifier.php from \vendor\tedivm\jshrink\src\JShrink Commented May 28, 2018 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.