<commit_before><?php
/**
 * This file is part of Sslurp.
 * https://github.com/EvanDotPro/Sslurp
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Sslurp;

/**
 * This class simply wraps an X.509 resource and exposes some handy stuff via
 * a friendly OOP interface.
 */
class X509Certificate
{
    /**
     * @var X.509 resource
     */
    private $certificate;

    /**
     * @var resource
     */
    private $publicKey;

    /**
     * @var array
     */
    private $publicKeyDetails;

    /**
     * @param $certificate mixed X.509 resource, X.509 certificate string, or path to X.509 certificate file.
     */
    public function __construct($certificate)
    {
        if (is_string($certificate)) {
            if(is_readable($certificate)) {
                $certificate = file_get_contents($certificate);
            }
            // We're surpressing errors here in favor of the more verbose exception below.
            $certificate = @openssl_x509_read($certificate);
        }

        if (@get_resource_type($certificate) !== 'OpenSSL X.509') {
            throw new \InvalidArgumentException('Argument passed to constructor'
                . ' of %s must be an X.509 resource, X.509 certificate string, or'
                . ' valid path to an X.509 certificate.');
        }

        $this->certificate = $certificate;
    }

    /**
     * Get the certificate pin.
     *
     * By <NAME> of StormTide Digital Studios Inc.
     * @KevinSMcArthur / https://github.com/StormTide
     *
     * See http://tools.ietf.org/html/draft-ietf-websec-key-pinning-02
     *
     * @return string
     */
    public function getPin()
    {<commit_msg>Control space CS fix<commit_after><?php
/**
 * This file is part of Sslurp.
 * https://github.com/EvanDotPro/Sslurp
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Sslurp;

/**
 * This class simply wraps an X.509 resource and exposes some handy stuff via
 * a friendly OOP interface.
 */
class X509Certificate
{
    /**
     * @var X.509 resource
     */
    private $certificate;

    /**
     * @var resource
     */
    private $publicKey;

    /**
     * @var array
     */
    private $publicKeyDetails;

    /**
     * @param $certificate mixed X.509 resource, X.509 certificate string, or path to X.509 certificate file.
     */
    public function __construct($certificate)
    {
        if (is_string($certificate)) {
            if (is_readable($certificate)) {
                $certificate = file_get_contents($certificate);
            }
            // We're surpressing errors here in favor of the more verbose exception below.
            $certificate = @openssl_x509_read($certificate);
        }

        if (@get_resource_type($certificate) !== 'OpenSSL X.509') {
            throw new \InvalidArgumentException('Argument passed to constructor'
                . ' of %s must be an X.509 resource, X.509 certificate string, or'
                . ' valid path to an X.509 certificate.');
        }

        $this->certificate = $certificate;
    }

    /**
     * Get the certificate pin.
     *
     * By <NAME> of StormTide Digital Studios Inc.
     * @KevinSMcArthur / https://github.com/StormTide
     *
     * See http://tools.ietf.org/html/draft-ietf-websec-key-pinning-02
     *
     * @return string
     */
    public function getPin()
    {
{'fraction_non_alphanumeric': 0.11316526610644258, 'fraction_numerical': 0.0196078431372549, 'mean_word_length': 2.151809355692851, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5807088', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1021, 'n_words': 302}