1
|
|
|
<?php |
2
|
|
|
namespace Checkdomain\Comodo\Model\Result; |
3
|
|
|
|
4
|
|
|
/** |
5
|
|
|
* Class CollectSslResult |
6
|
|
|
*/ |
7
|
|
|
class CollectSslResult extends AbstractResult |
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* @var integer |
11
|
|
|
*/ |
12
|
|
|
protected $orderNumber; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* @var integer |
16
|
|
|
*/ |
17
|
|
|
protected $errorCode; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @var \DateTime |
21
|
|
|
*/ |
22
|
|
|
protected $notBefore; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @var \DateTime |
26
|
|
|
*/ |
27
|
|
|
protected $notAfter; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var string |
31
|
|
|
*/ |
32
|
|
|
protected $fqdn; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var string |
36
|
|
|
*/ |
37
|
|
|
protected $zipFile; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @var string |
41
|
|
|
*/ |
42
|
|
|
protected $netscapeCertificateSequence; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @var string |
46
|
|
|
*/ |
47
|
|
|
protected $pkcs7; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @var array |
51
|
|
|
*/ |
52
|
|
|
protected $caCertificate; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @var string |
56
|
|
|
*/ |
57
|
|
|
protected $certificate; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @var string |
61
|
|
|
*/ |
62
|
|
|
protected $certificateStatus; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @var string |
66
|
|
|
*/ |
67
|
|
|
protected $validationStatus; |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @var string |
71
|
|
|
*/ |
72
|
|
|
protected $mdcDomainDetails; |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @var string |
76
|
|
|
*/ |
77
|
|
|
protected $mdcDomainDetails2; |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @var integer |
81
|
|
|
*/ |
82
|
|
|
protected $csrStatus; |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @var integer |
86
|
|
|
*/ |
87
|
|
|
protected $dcvStatus; |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @var integer |
91
|
|
|
*/ |
92
|
|
|
protected $ovCallBackStatus; |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @var integer |
96
|
|
|
*/ |
97
|
|
|
protected $organizationValidationStatus; |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @var integer |
101
|
|
|
*/ |
102
|
|
|
protected $freeDVUPStatus; |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @var integer |
106
|
|
|
*/ |
107
|
|
|
protected $evClickThroughStatus; |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @param bool $wrapCrt |
111
|
|
|
* @param bool $addDelimiter |
112
|
|
|
* |
113
|
|
|
* @return array|null |
114
|
|
|
*/ |
115
|
|
|
public function getCaCertificate($wrapCrt = true, $addDelimiter = true) |
116
|
|
|
{ |
117
|
|
|
$crt = $this->caCertificate; |
118
|
|
|
|
119
|
|
|
if ($crt === null) { |
120
|
|
|
return null; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
foreach ($crt as $i => $val) { |
124
|
|
|
if ($wrapCrt) { |
125
|
|
|
$crt[$i] = $this->wrapCrt($crt[$i]); |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
if ($addDelimiter) { |
129
|
|
|
$crt[$i] = $this->addDelimiter($crt[$i]); |
130
|
|
|
} |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
// This is the right order |
134
|
|
|
$crt = array_reverse($crt); |
135
|
|
|
|
136
|
|
|
return $crt; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* @param array $caCertificate |
141
|
|
|
* |
142
|
|
|
* @return CollectSslResult |
143
|
|
|
*/ |
144
|
|
|
public function setCaCertificate($caCertificate) |
145
|
|
|
{ |
146
|
|
|
$this->caCertificate = $caCertificate; |
147
|
|
|
|
148
|
|
|
return $this; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* @param bool $wrapCrt |
153
|
|
|
* @param bool $addDelimiter |
154
|
|
|
* |
155
|
|
|
* @return string|null |
156
|
|
|
*/ |
157
|
|
|
public function getCertificate($wrapCrt = true, $addDelimiter = true) |
158
|
|
|
{ |
159
|
|
|
$crt = $this->certificate; |
160
|
|
|
|
161
|
|
|
if ($crt === null) { |
162
|
|
|
return null; |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
if ($addDelimiter) { |
166
|
|
|
$crt = $this->addDelimiter($crt); |
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
if ($wrapCrt) { |
170
|
|
|
$crt = $this->wrapCrt($crt); |
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
return $crt; |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* @param string $certificate |
178
|
|
|
* |
179
|
|
|
* @return CollectSslResult |
180
|
|
|
*/ |
181
|
|
|
public function setCertificate($certificate) |
182
|
|
|
{ |
183
|
|
|
$this->certificate = $certificate; |
184
|
|
|
|
185
|
|
|
return $this; |
186
|
|
|
} |
187
|
|
|
|
188
|
|
|
/** |
189
|
|
|
* @return string |
190
|
|
|
*/ |
191
|
|
|
public function getCertificateStatus() |
192
|
|
|
{ |
193
|
|
|
return $this->certificateStatus; |
194
|
|
|
} |
195
|
|
|
|
196
|
|
|
/** |
197
|
|
|
* @param string $certificateStatus |
198
|
|
|
* |
199
|
|
|
* @return CollectSslResult |
200
|
|
|
*/ |
201
|
|
|
public function setCertificateStatus($certificateStatus) |
202
|
|
|
{ |
203
|
|
|
$this->certificateStatus = $certificateStatus; |
204
|
|
|
|
205
|
|
|
return $this; |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* @return int |
210
|
|
|
*/ |
211
|
|
|
public function getCsrStatus() |
212
|
|
|
{ |
213
|
|
|
return $this->csrStatus; |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
/** |
217
|
|
|
* @param int $csrStatus |
218
|
|
|
* |
219
|
|
|
* @return CollectSslResult |
220
|
|
|
*/ |
221
|
|
|
public function setCsrStatus($csrStatus) |
222
|
|
|
{ |
223
|
|
|
$this->csrStatus = $csrStatus; |
224
|
|
|
|
225
|
|
|
return $this; |
226
|
|
|
} |
227
|
|
|
|
228
|
|
|
/** |
229
|
|
|
* @return int |
230
|
|
|
*/ |
231
|
|
|
public function getDcvStatus() |
232
|
|
|
{ |
233
|
|
|
return $this->dcvStatus; |
234
|
|
|
} |
235
|
|
|
|
236
|
|
|
/** |
237
|
|
|
* @param int $dcvStatus |
238
|
|
|
* |
239
|
|
|
* @return CollectSslResult |
240
|
|
|
*/ |
241
|
|
|
public function setDcvStatus($dcvStatus) |
242
|
|
|
{ |
243
|
|
|
$this->dcvStatus = $dcvStatus; |
244
|
|
|
|
245
|
|
|
return $this; |
246
|
|
|
} |
247
|
|
|
|
248
|
|
|
/** |
249
|
|
|
* @return int |
250
|
|
|
*/ |
251
|
|
|
public function getEvClickThroughStatus() |
252
|
|
|
{ |
253
|
|
|
return $this->evClickThroughStatus; |
254
|
|
|
} |
255
|
|
|
|
256
|
|
|
/** |
257
|
|
|
* @param int $evClickThroughStatus |
258
|
|
|
* |
259
|
|
|
* @return CollectSslResult |
260
|
|
|
*/ |
261
|
|
|
public function setEvClickThroughStatus($evClickThroughStatus) |
262
|
|
|
{ |
263
|
|
|
$this->evClickThroughStatus = $evClickThroughStatus; |
264
|
|
|
|
265
|
|
|
return $this; |
266
|
|
|
} |
267
|
|
|
|
268
|
|
|
/** |
269
|
|
|
* @return string |
270
|
|
|
*/ |
271
|
|
|
public function getFqdn() |
272
|
|
|
{ |
273
|
|
|
return $this->fqdn; |
274
|
|
|
} |
275
|
|
|
|
276
|
|
|
/** |
277
|
|
|
* @param string $fqdn |
278
|
|
|
* |
279
|
|
|
* @return CollectSslResult |
280
|
|
|
*/ |
281
|
|
|
public function setFqdn($fqdn) |
282
|
|
|
{ |
283
|
|
|
$this->fqdn = $fqdn; |
284
|
|
|
|
285
|
|
|
return $this; |
286
|
|
|
} |
287
|
|
|
|
288
|
|
|
/** |
289
|
|
|
* @return int |
290
|
|
|
*/ |
291
|
|
|
public function getFreeDVUPStatus() |
292
|
|
|
{ |
293
|
|
|
return $this->freeDVUPStatus; |
294
|
|
|
} |
295
|
|
|
|
296
|
|
|
/** |
297
|
|
|
* @param int $freeDVUPStatus |
298
|
|
|
* |
299
|
|
|
* @return CollectSslResult |
300
|
|
|
*/ |
301
|
|
|
public function setFreeDVUPStatus($freeDVUPStatus) |
302
|
|
|
{ |
303
|
|
|
$this->freeDVUPStatus = $freeDVUPStatus; |
304
|
|
|
|
305
|
|
|
return $this; |
306
|
|
|
} |
307
|
|
|
|
308
|
|
|
/** |
309
|
|
|
* @return string |
310
|
|
|
*/ |
311
|
|
|
public function getMdcDomainDetails() |
312
|
|
|
{ |
313
|
|
|
return $this->mdcDomainDetails; |
314
|
|
|
} |
315
|
|
|
|
316
|
|
|
/** |
317
|
|
|
* @param string $mdcDomainDetails |
318
|
|
|
* |
319
|
|
|
* @return CollectSslResult |
320
|
|
|
*/ |
321
|
|
|
public function setMdcDomainDetails($mdcDomainDetails) |
322
|
|
|
{ |
323
|
|
|
$this->mdcDomainDetails = $mdcDomainDetails; |
324
|
|
|
|
325
|
|
|
return $this; |
326
|
|
|
} |
327
|
|
|
|
328
|
|
|
/** |
329
|
|
|
* @return string |
330
|
|
|
*/ |
331
|
|
|
public function getMdcDomainDetails2() |
332
|
|
|
{ |
333
|
|
|
return $this->mdcDomainDetails2; |
334
|
|
|
} |
335
|
|
|
|
336
|
|
|
/** |
337
|
|
|
* @param string $mdcDomainDetails2 |
338
|
|
|
* |
339
|
|
|
* @return CollectSslResult |
340
|
|
|
*/ |
341
|
|
|
public function setMdcDomainDetails2($mdcDomainDetails2) |
342
|
|
|
{ |
343
|
|
|
$this->mdcDomainDetails2 = $mdcDomainDetails2; |
344
|
|
|
|
345
|
|
|
return $this; |
346
|
|
|
} |
347
|
|
|
|
348
|
|
|
/** |
349
|
|
|
* @return string |
350
|
|
|
*/ |
351
|
|
|
public function getNetscapeCertificateSequence() |
352
|
|
|
{ |
353
|
|
|
return $this->netscapeCertificateSequence; |
354
|
|
|
} |
355
|
|
|
|
356
|
|
|
/** |
357
|
|
|
* @param string $netscapeCertificateSequence |
358
|
|
|
* |
359
|
|
|
* @return CollectSslResult |
360
|
|
|
*/ |
361
|
|
|
public function setNetscapeCertificateSequence($netscapeCertificateSequence) |
362
|
|
|
{ |
363
|
|
|
$this->netscapeCertificateSequence = $netscapeCertificateSequence; |
364
|
|
|
|
365
|
|
|
return $this; |
366
|
|
|
} |
367
|
|
|
|
368
|
|
|
/** |
369
|
|
|
* @return \DateTime |
370
|
|
|
*/ |
371
|
|
|
public function getNotAfter() |
372
|
|
|
{ |
373
|
|
|
return $this->notAfter; |
374
|
|
|
} |
375
|
|
|
|
376
|
|
|
/** |
377
|
|
|
* @param \DateTime $notAfter |
378
|
|
|
* |
379
|
|
|
* @return CollectSslResult |
380
|
|
|
*/ |
381
|
|
|
public function setNotAfter($notAfter) |
382
|
|
|
{ |
383
|
|
|
$this->notAfter = $notAfter; |
384
|
|
|
|
385
|
|
|
return $this; |
386
|
|
|
} |
387
|
|
|
|
388
|
|
|
/** |
389
|
|
|
* @return \DateTime |
390
|
|
|
*/ |
391
|
|
|
public function getNotBefore() |
392
|
|
|
{ |
393
|
|
|
return $this->notBefore; |
394
|
|
|
} |
395
|
|
|
|
396
|
|
|
/** |
397
|
|
|
* @param \DateTime $notBefore |
398
|
|
|
* |
399
|
|
|
* @return CollectSslResult |
400
|
|
|
*/ |
401
|
|
|
public function setNotBefore($notBefore) |
402
|
|
|
{ |
403
|
|
|
$this->notBefore = $notBefore; |
404
|
|
|
|
405
|
|
|
return $this; |
406
|
|
|
} |
407
|
|
|
|
408
|
|
|
/** |
409
|
|
|
* @return int |
410
|
|
|
*/ |
411
|
|
|
public function getOrderNumber() |
412
|
|
|
{ |
413
|
|
|
return $this->orderNumber; |
414
|
|
|
} |
415
|
|
|
|
416
|
|
|
/** |
417
|
|
|
* @param int $orderNumber |
418
|
|
|
* |
419
|
|
|
* @return CollectSslResult |
420
|
|
|
*/ |
421
|
|
|
public function setOrderNumber($orderNumber) |
422
|
|
|
{ |
423
|
|
|
$this->orderNumber = $orderNumber; |
424
|
|
|
|
425
|
|
|
return $this; |
426
|
|
|
} |
427
|
|
|
|
428
|
|
|
/** |
429
|
|
|
* @return int |
430
|
|
|
*/ |
431
|
|
|
public function getErrorCode() |
432
|
|
|
{ |
433
|
|
|
return $this->errorCode; |
434
|
|
|
} |
435
|
|
|
|
436
|
|
|
/** |
437
|
|
|
* @param int $errorCode |
438
|
|
|
* |
439
|
|
|
* @return $this |
440
|
|
|
*/ |
441
|
|
|
public function setErrorCode($errorCode) |
442
|
|
|
{ |
443
|
|
|
$this->errorCode = $errorCode; |
444
|
|
|
|
445
|
|
|
return $this; |
446
|
|
|
} |
447
|
|
|
|
448
|
|
|
/** |
449
|
|
|
* @return int |
450
|
|
|
*/ |
451
|
|
|
public function getOrganizationValidationStatus() |
452
|
|
|
{ |
453
|
|
|
return $this->organizationValidationStatus; |
454
|
|
|
} |
455
|
|
|
|
456
|
|
|
/** |
457
|
|
|
* @param int $organizationValidationStatus |
458
|
|
|
* |
459
|
|
|
* @return CollectSslResult |
460
|
|
|
*/ |
461
|
|
|
public function setOrganizationValidationStatus($organizationValidationStatus) |
462
|
|
|
{ |
463
|
|
|
$this->organizationValidationStatus = $organizationValidationStatus; |
464
|
|
|
|
465
|
|
|
return $this; |
466
|
|
|
} |
467
|
|
|
|
468
|
|
|
/** |
469
|
|
|
* @return int |
470
|
|
|
*/ |
471
|
|
|
public function getOvCallBackStatus() |
472
|
|
|
{ |
473
|
|
|
return $this->ovCallBackStatus; |
474
|
|
|
} |
475
|
|
|
|
476
|
|
|
/** |
477
|
|
|
* @param int $ovCallBackStatus |
478
|
|
|
* |
479
|
|
|
* @return CollectSslResult |
480
|
|
|
*/ |
481
|
|
|
public function setOvCallBackStatus($ovCallBackStatus) |
482
|
|
|
{ |
483
|
|
|
$this->ovCallBackStatus = $ovCallBackStatus; |
484
|
|
|
|
485
|
|
|
return $this; |
486
|
|
|
} |
487
|
|
|
|
488
|
|
|
/** |
489
|
|
|
* @return string |
490
|
|
|
*/ |
491
|
|
|
public function getPkcs7() |
492
|
|
|
{ |
493
|
|
|
return $this->pkcs7; |
494
|
|
|
} |
495
|
|
|
|
496
|
|
|
/** |
497
|
|
|
* @param string $pkcs7 |
498
|
|
|
* |
499
|
|
|
* @return CollectSslResult |
500
|
|
|
*/ |
501
|
|
|
public function setPkcs7($pkcs7) |
502
|
|
|
{ |
503
|
|
|
$this->pkcs7 = $pkcs7; |
504
|
|
|
|
505
|
|
|
return $this; |
506
|
|
|
} |
507
|
|
|
|
508
|
|
|
/** |
509
|
|
|
* @return string |
510
|
|
|
*/ |
511
|
|
|
public function getValidationStatus() |
512
|
|
|
{ |
513
|
|
|
return $this->validationStatus; |
514
|
|
|
} |
515
|
|
|
|
516
|
|
|
/** |
517
|
|
|
* @param string $validationStatus |
518
|
|
|
* |
519
|
|
|
* @return CollectSslResult |
520
|
|
|
*/ |
521
|
|
|
public function setValidationStatus($validationStatus) |
522
|
|
|
{ |
523
|
|
|
$this->validationStatus = $validationStatus; |
524
|
|
|
|
525
|
|
|
return $this; |
526
|
|
|
} |
527
|
|
|
|
528
|
|
|
/** |
529
|
|
|
* @return string |
530
|
|
|
*/ |
531
|
|
|
public function getZipFile() |
532
|
|
|
{ |
533
|
|
|
return $this->zipFile; |
534
|
|
|
} |
535
|
|
|
|
536
|
|
|
/** |
537
|
|
|
* @param string $zipFile |
538
|
|
|
* |
539
|
|
|
* @return CollectSslResult |
540
|
|
|
*/ |
541
|
|
|
public function setZipFile($zipFile) |
542
|
|
|
{ |
543
|
|
|
$this->zipFile = $zipFile; |
544
|
|
|
|
545
|
|
|
return $this; |
546
|
|
|
} |
547
|
|
|
|
548
|
|
|
/** |
549
|
|
|
* @param string $crtContent |
550
|
|
|
* |
551
|
|
|
* @return string |
552
|
|
|
*/ |
553
|
|
|
protected function addDelimiter($crtContent) |
554
|
|
|
{ |
555
|
|
|
$crtContent = |
556
|
|
|
'-----BEGIN CERTIFICATE-----'.chr(10). |
557
|
|
|
$crtContent.chr(10). |
558
|
|
|
'-----END CERTIFICATE-----'; |
559
|
|
|
|
560
|
|
|
return $crtContent; |
561
|
|
|
} |
562
|
|
|
|
563
|
|
|
/** |
564
|
|
|
* @param string $crtContent |
565
|
|
|
* |
566
|
|
|
* @return string |
567
|
|
|
*/ |
568
|
|
|
protected function wrapCrt($crtContent) |
569
|
|
|
{ |
570
|
|
|
$crtContent = wordwrap($crtContent, 64, chr(10), true); |
571
|
|
|
|
572
|
|
|
return $crtContent; |
573
|
|
|
} |
574
|
|
|
} |
575
|
|
|
|