Spatie\Certificate\Certificate::guardAgainstInvalidContents PHP Method

guardAgainstInvalidContents() protected method

Check if inputfile is correct.
protected guardAgainstInvalidContents ( $contents )
$contents
    protected function guardAgainstInvalidContents($contents)
    {
        $x509 = new X509();
        if (!$x509->loadX509($contents)) {
            throw new Exception('Invalid inputfile given.');
        }
    }