cn(); default: throw new \App\Exceptions\SSLUnknownAttribute($key); } } private function cn() { $subject = array_get($this->crt,'subject'); if (! $subject AND $this->csr_pem) { $subject = openssl_csr_get_subject($this->csr_pem); } return isset($subject['CN']) ? $subject['CN'] : NULL; } /** * Add CSR * * @param $value * @return mixed */ public function csr($value) { $this->csr_pem = $value; return $this; } /** * Add certificate * * @param $value * @return mixed */ public function crt($value) { $this->crt_pem = $value; $this->crt = openssl_x509_parse($this->crt); return $this; } /** * Add the Key * * @param $value * @return mixed */ public function key($value) { $this->key_pem = $value; return $this; } }