public function fromFile($filePath)
    {
        $pemString = file_get_contents($filePath);

        if (!$pemString) {
            throw new RuntimeException("Unable to read file at path '$filePath'.");
        }

        try {
            $certificate = $this->fromString($pemString);
        } catch (Exception $e) {
            throw new RuntimeException("File at '$filePath' does not contain a valid certificate.", 0, $e);
        }
        return $certificate;
    }