static function savePublicKey(BigInteger $n, BigInteger $e) { $key = ['modulus' => $n, 'publicExponent' => $e]; $asn1 = new ASN1(); $key = $asn1->encodeDER($key, RSAPublicKey); return self::wrapPublicKey($key, 'RSA'); }
/** * Convert a public key to the appropriate format * * @access public * @param \phpseclib\Math\BigInteger $n * @param \phpseclib\Math\BigInteger $e * @return string */ static function savePublicKey(BigInteger $n, BigInteger $e) { $key = PKCS1::savePublicKey($n, $e); $key = ASN1::extractBER($key); return self::wrapPublicKey($key, '1.2.840.113549.1.1.1'); }