summaryrefslogtreecommitdiffstats
path: root/src/Objects/Chain.php
diff options
context:
space:
mode:
authorBjörn Roland <bjoern.roland@intradesys.com>2015-11-18 00:01:35 +0100
committerBjörn Roland <bjoern.roland@intradesys.com>2015-11-18 00:01:35 +0100
commit1c880fae48099471dc6a2155c205b8d539e3a31b (patch)
treefed41010343287cb4b0271768f8c651fe1685ee1 /src/Objects/Chain.php
parent325a9e3e422215e9df3c7887a894a22f6594a368 (diff)
downloadphp-ssllabs-api-1c880fae48099471dc6a2155c205b8d539e3a31b.zip
php-ssllabs-api-1c880fae48099471dc6a2155c205b8d539e3a31b.tar.gz
php-ssllabs-api-1c880fae48099471dc6a2155c205b8d539e3a31b.tar.bz2
Composer support ; started response object to PHP object mapping, Exceptions, Calls
Diffstat (limited to 'src/Objects/Chain.php')
-rw-r--r--src/Objects/Chain.php61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/Objects/Chain.php b/src/Objects/Chain.php
new file mode 100644
index 0000000..1ec239c
--- /dev/null
+++ b/src/Objects/Chain.php
@@ -0,0 +1,61 @@
+<?php
+namespace BjoernrDe\SSLLabsApi\Objects;
+
+class Chain implements ApiObject
+{
+ private $chain = array();
+ private $issues;
+
+ public function getChain()
+ {
+ return ($this->chain);
+ }
+
+ private function setChain($chain)
+ {
+ $this->chain = $chain;
+ }
+
+ public function getIssues()
+ {
+ return ($this->issues);
+ }
+
+ private function setIssues($issues)
+ {
+ $this->issues = $issues;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @return \SSLLabsApi\Objects\Cert
+ * @see \SSLLabsApi\Objects\ApiObject::populateObjectByApiResponse()
+ */
+ public function populateObjectByApiResponse($jsonString)
+ {
+ $response = json_decode($jsonString);
+
+ isset($response->subject) ? $this->setSubject($response->subject) : '';
+ isset($response->commonNames) ? $this->setCommonNames($response->commonNames) : '';
+ isset($response->altNames) ? $this->setAltNames($response->altNames) : '';
+ isset($response->notBefore) ? $this->setNotBefore($response->notBefore) : '';
+ isset($response->notAfter) ? $this->setNotAfter($response->notAfter) : '';
+ isset($response->issuerSubject) ? $this->setIssuerSubject($response->issuerSubject) : '';
+ isset($response->issuerLabel) ? $this->setIssuerLabel($response->issuerLabel) : '';
+ isset($response->sigAlg) ? $this->setSigAlg($response->sigAlg) : '';
+ isset($response->revocationInfo) ? $this->setRevocationInfo($response->revocationInfo) : '';
+ isset($response->crlURIs) ? $this->setCrlURIs($response->crlURIs) : '';
+ isset($response->ocspURIs) ? $this->setOcspURIs($response->ocspURIs) : '';
+ isset($response->revocationStatus) ? $this->setRevocationStatus($response->revocationStatus) : '';
+ isset($response->crlRevocationStatus) ? $this->setCrlRevocationStatus($response->crlRevocationStatus) : '';
+ isset($response->ocspRevocationStatus) ? $this->setOcspRevocationStatus($response->ocspRevocationStatus) : '';
+ isset($response->sgc) ? $this->setSgc($response->sgc) : '';
+ isset($response->issues) ? $this->setIssues($response->issues) : '';
+ isset($response->sct) ? $this->setSct($response->sct) : '';
+ isset($response->sha1Hash) ? $this->setSha1Hash($response->sha1Hash) : '';
+ isset($response->pinSha256) ? $this->setPinSha256($response->pinSha256) : '';
+
+ return ($this);
+ }
+} \ No newline at end of file