SSL module updates and random class addition

This commit is contained in:
Deon George
2012-05-09 00:59:08 +10:00
parent 01d7f09a68
commit 1d2d589ff5
7 changed files with 131 additions and 23 deletions

View File

@@ -38,7 +38,26 @@ class Model_Service_Plugin_SSL extends Model_Service_Plugin {
}
public function name() {
return $this->display($this->cert ? 'cert' : 'csr');
if ($this->cert) {
return sprintf('%s:%s',$this->ssl_ca->subject(),$this->display('cert'));
} else
return $this->display('csr');
}
public function algorithm() {
return SSL::algorithm($this->cert);
}
public function dn() {
return SSL::dn($this->cert);
}
public function dnissuer() {
return SSL::dnissuer($this->cert);
}
public function issuer() {
return SSL::issuer($this->cert);
}
// @todo This needs to be validated for this model
@@ -49,6 +68,10 @@ class Model_Service_Plugin_SSL extends Model_Service_Plugin {
return $this->service->product->plugin();
}
public function details() {
return SSL::details($this->cert);
}
public function valid_from($format=FALSE) {
return SSL::from($this->cert,$format);
}
@@ -132,6 +155,7 @@ class Model_Service_Plugin_SSL extends Model_Service_Plugin {
$res = openssl_csr_sign($this->csr,$this->ssl_ca->sign_cert,$this->ssl_ca->sign_pk,$this->service->product->plugin()->days,array(
'config'=>$ssl_conf['config'],
'x509_extensions'=>$this->service->product->plugin()->extensions,
'digest_alg'=>'sha1',
),time());
if ($res AND openssl_x509_export($res,$cert)) {