Esempio n. 1
0
 /**
  * Request and check a list of domain.
  *
  * @param array $domains
  *
  * @throws \Exception
  */
 public function challengeDomains(array $domains)
 {
     Assert::allStringNotEmpty($domains, 'challengeDomains::$domains expected an array of non-empty string. Got: %s');
     foreach (array_unique($domains) as $domain) {
         $this->challengeDomain($domain);
     }
 }
Esempio n. 2
0
 /**
  * @param Certificate $source
  * @param string      $subject
  * @param string      $issuer
  * @param bool        $selfSigned
  * @param \DateTime   $validFrom
  * @param \DateTime   $validTo
  * @param string      $serialNumber
  * @param array       $subjectAlternativeNames
  */
 public function __construct(Certificate $source, $subject, $issuer = null, $selfSigned = true, \DateTime $validFrom = null, \DateTime $validTo = null, $serialNumber = null, array $subjectAlternativeNames = [])
 {
     Assert::stringNotEmpty($subject, __CLASS__ . '::$subject expected a non empty string. Got: %s');
     Assert::nullOrString($issuer, __CLASS__ . '::$issuer expected a string or null. Got: %s');
     Assert::nullOrBoolean($selfSigned, __CLASS__ . '::$selfSigned expected a boolean or null. Got: %s');
     Assert::nullOrString($serialNumber, __CLASS__ . '::$serialNumber expected a string or null. Got: %s');
     Assert::allStringNotEmpty($subjectAlternativeNames, __CLASS__ . '::$subjectAlternativeNames expected a array of non empty string. Got: %s');
     $this->source = $source;
     $this->subject = $subject;
     $this->issuer = $issuer;
     $this->selfSigned = $selfSigned;
     $this->validFrom = $validFrom;
     $this->validTo = $validTo;
     $this->serialNumber = $serialNumber;
     $this->subjectAlternativeNames = $subjectAlternativeNames;
 }
Esempio n. 3
0
 /**
  * @param string $commonName
  * @param string $countryName
  * @param string $stateOrProvinceName
  * @param string $localityName
  * @param string $organizationName
  * @param string $organizationalUnitName
  * @param string $emailAddress
  * @param array  $subjectAlternativeNames
  */
 public function __construct($commonName, $countryName = null, $stateOrProvinceName = null, $localityName = null, $organizationName = null, $organizationalUnitName = null, $emailAddress = null, array $subjectAlternativeNames = [])
 {
     Assert::stringNotEmpty($commonName, __CLASS__ . '::$commonName expected a non empty string. Got: %s');
     Assert::nullOrString($countryName, __CLASS__ . '::$countryName expected a string. Got: %s');
     Assert::nullOrString($stateOrProvinceName, __CLASS__ . '::$stateOrProvinceName expected a string. Got: %s');
     Assert::nullOrString($localityName, __CLASS__ . '::$localityName expected a string. Got: %s');
     Assert::nullOrString($organizationName, __CLASS__ . '::$organizationName expected a string. Got: %s');
     Assert::nullOrString($organizationalUnitName, __CLASS__ . '::$organizationalUnitName expected a string. Got: %s');
     Assert::nullOrString($emailAddress, __CLASS__ . '::$emailAddress expected a string. Got: %s');
     Assert::allStringNotEmpty($subjectAlternativeNames, __CLASS__ . '::$subjectAlternativeNames expected an array of non empty string. Got: %s');
     $this->commonName = $commonName;
     $this->countryName = $countryName;
     $this->stateOrProvinceName = $stateOrProvinceName;
     $this->localityName = $localityName;
     $this->organizationName = $organizationName;
     $this->organizationalUnitName = $organizationalUnitName;
     $this->emailAddress = $emailAddress;
     $this->subjectAlternativeNames = array_diff(array_unique($subjectAlternativeNames), [$commonName]);
 }