1: <?php
2:
3: namespace Cloudflare\Zone\SSL;
4:
5: use Cloudflare\Api;
6: use Cloudflare\Zone;
7: use Cloudflare\Zone\SSL;
8:
9: /**
10: * CloudFlare API wrapper
11: *
12: * Analyze Certificate
13: *
14: * @author James Bell <[email protected]>
15: *
16: * @version 1
17: */
18: class Analyze extends Api
19: {
20: /**
21: * Default permissions level
22: *
23: * @var array
24: */
25: protected $permission_level = ['read' => '#ssl:read', 'edit' => '#ssl:edit'];
26:
27: /**
28: * Analyze Certificate (permission needed: #ssl:read)
29: * Returns the set of hostnames, the signature algorithm, and the expiration date of the certificate.
30: *
31: * @param string $identifier
32: * @param string $certificate The zone's SSL certificate or certificate and the intermediate(s)
33: * @param string|null $bundle_method A ubiquitous bundle is a bundle that has a higher probability of
34: * being verified everywhere, even by clients using outdated or unusual
35: * trust stores. An optimal bundle is a bundle with the shortest chain and
36: * newest intermediates. A forced method attempt to use the certificate/chain
37: * as defined by the input
38: */
39: public function analyze($identifier, $certificate, $bundle_method = null)
40: {
41: $data = [
42: 'certificate' => $certificate,
43: 'bundle_method' => $bundle_method,
44: ];
45:
46: return $this->post('/zones/'.$identifier.'/ssl/analyze', $data);
47: }
48: }
49: