public function loadCertificateFile(string $certificateFile) : void
    {
        $certificate = File::getFileContents($certificateFile);

        if (!Certificate::hasValidStructure($certificate)) {
            throw new InvalidCertificateStructureException(sprintf(
                'Could not find PEM encoded certificate in "%s"',
                $certificateFile
            ));
        }

        // capture the certificate contents without the delimiters
        preg_match(Certificate::CERTIFICATE_PATTERN, $certificate, $matches);
        $this->loadedKeys->add(X509::createFromCertificateData($matches[1]));
    }
public function loadCertificateFile(string $certificateFile) : void
    {
        $certificate = File::getFileContents($certificateFile);

        if (!Certificate::hasValidStructure($certificate)) {
            throw new InvalidCertificateStructureException(sprintf(
                'Could not find PEM encoded certificate in "%s"',
                $certificateFile
            ));
        }

        // capture the certificate contents without the delimiters
        preg_match(Certificate::CERTIFICATE_PATTERN, $certificate, $matches);
        $this->loadedKeys->add(X509::createFromCertificateData($matches[1]));
    }
public function loadCertificateFile ( string $ certificateFile ) : void { $ certificate = File :: getFileContents ( $ certificateFile ) ; if ( ! Certificate :: hasValidStructure ( $ certificate ) ) { throw new InvalidCertificateStructureException ( sprintf ( 'Could not find PEM encoded certificate in "%s"' , $ certificateFile ) ) ; } // capture the certificate contents without the delimiters preg_match ( Certificate :: CERTIFICATE_PATTERN , $ certificate , $ matches ) ; $ this -> loadedKeys -> add ( X509 :: createFromCertificateData ( $ matches [ 1 ] ) ) ; }
Loads the certificate in the file given

@param string $certificateFile the full path to the cert file.
@return void
Loads the certificate in the file given