I'm not sure, but I think this is a bug

first set key as a certificate string
openssl_x509_export($this->key, $str_cert);
...
$this->key = $str_cert;

and then try to get privatekey from cert string
$this->key = openssl_get_privatekey($this->key, $this->passphrase);

If I'm not right, then sorry for wasting your time.