/** * Initialize from RSAPublicKey. * * @param RSAPublicKey $pk * @return self */ public static function fromRSAPublicKey(RSAPublicKey $pk) { $n = ModulusParameter::fromNumber($pk->modulus()); $e = ExponentParameter::fromNumber($pk->publicExponent()); $key_type = new KeyTypeParameter(KeyTypeParameter::TYPE_RSA); return new self($key_type, $n, $e); }