Skip to content
This repository has been archived by the owner on Nov 2, 2022. It is now read-only.

Commit

Permalink
Added SSL analysis and certificate packs
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesryanbell committed Jun 5, 2016
1 parent fdd5c45 commit 8616dde
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -2,7 +2,7 @@
"name": "jamesryanbell/cloudflare",
"description": "Cloudflare API V4 PHP wrapper",
"license": "MIT",
"version": "1.4.0",
"version": "1.5.0",
"keywords": ["cloudflare", "api"],
"authors": [
{
Expand Down
45 changes: 45 additions & 0 deletions src/CloudFlare/Zone/SSL/Analyze.php
@@ -0,0 +1,45 @@
<?php

namespace Cloudflare\Zone\SSL;

use Cloudflare\Api;
use Cloudflare\Zone;
use Cloudflare\Zone\SSL;

/**
* CloudFlare API wrapper
*
* Analyze Certificate
*
* @author James Bell <james@james-bell.co.uk>
* @version 1
*/

class Analyze extends Api
{
/**
* Default permissions level
* @var array
*/
protected $permission_level = array('read' => '#ssl:read', 'edit' => '#ssl:edit');

/**
* Analyze Certificate (permission needed: #ssl:read)
* Returns the set of hostnames, the signature algorithm, and the expiration date of the certificate.
* @param string $identifier
* @param string $certificate The zone's SSL certificate or certificate and the intermediate(s)
* @param string|null $bundle_method A ubiquitous bundle is a bundle that has a higher probability of
* being verified everywhere, even by clients using outdated or unusual
* trust stores. An optimal bundle is a bundle with the shortest chain and
* newest intermediates. A forced method attempt to use the certificate/chain
* as defined by the input
*/
public function analyze($identifier, $certificate, $bundle_method = null)
{
$data = array(
'certificate' => $certificate,
'bundle_method' => $bundle_method
);
return $this->post('/zones/' . $identifier . '/ssl/analyze', $data);
}
}
35 changes: 35 additions & 0 deletions src/CloudFlare/Zone/SSL/CertificatePacks.php
@@ -0,0 +1,35 @@
<?php

namespace Cloudflare\Zone\SSL;

use Cloudflare\Api;
use Cloudflare\Zone;
use Cloudflare\Zone\SSL;

/**
* CloudFlare API wrapper
*
* Certificate Packs
*
* @author James Bell <james@james-bell.co.uk>
* @version 1
*/

class CertificatePacks extends Api
{
/**
* Default permissions level
* @var array
*/
protected $permission_level = array('read' => '#ssl:read', 'edit' => '#ssl:edit');

/**
* List all certificate packs (permission needed: #ssl:read)
* For a given zone, list all certificate packs
* @param string $identifier
*/
public function certificate_packs($identifier)
{
return $this->get('/zones/' . $identifier . '/ssl/certificate_packs');
}
}

0 comments on commit 8616dde

Please sign in to comment.