| 1 | <?php  | 
            ||
| 5 | class Certificate  | 
            ||
| 6 | { | 
            ||
| 7 | /**  | 
            ||
| 8 | * @var string  | 
            ||
| 9 | */  | 
            ||
| 10 | private $certificateString;  | 
            ||
| 11 | |||
| 12 | /**  | 
            ||
| 13 | * @var string  | 
            ||
| 14 | */  | 
            ||
| 15 | private $password;  | 
            ||
| 16 | |||
| 17 | /**  | 
            ||
| 18 | * Construct.  | 
            ||
| 19 | *  | 
            ||
| 20 | * @param string $certificateString  | 
            ||
| 21 | * @param string $password  | 
            ||
| 22 | */  | 
            ||
| 23 | public function __construct($certificateString, $password = null)  | 
            ||
| 28 | |||
| 29 | /**  | 
            ||
| 30 | * Gets the certificate string.  | 
            ||
| 31 | *  | 
            ||
| 32 | * @return string $certificateString  | 
            ||
| 33 | */  | 
            ||
| 34 | public function getCertificateString()  | 
            ||
| 38 | |||
| 39 | /**  | 
            ||
| 40 | * Gets the certificate password.  | 
            ||
| 41 | *  | 
            ||
| 42 | * @return string $password  | 
            ||
| 43 | */  | 
            ||
| 44 | public function getPassword()  | 
            ||
| 48 | |||
| 49 | /**  | 
            ||
| 50 | * Writes the certificate to the given file path.  | 
            ||
| 51 | *  | 
            ||
| 52 | * @param string $path  | 
            ||
| 53 | */  | 
            ||
| 54 | public function writeTo($path)  | 
            ||
| 58 | |||
| 59 | /**  | 
            ||
| 60 | * Writes the certificate to a temporary file and returns the path.  | 
            ||
| 61 | *  | 
            ||
| 62 | * @return string $path  | 
            ||
| 63 | */  | 
            ||
| 64 | public function writeToTmp()  | 
            ||
| 72 | |||
| 73 | /**  | 
            ||
| 74 | * @return string  | 
            ||
| 75 | */  | 
            ||
| 76 | public function __toString()  | 
            ||
| 80 | }  | 
            ||
| 81 |