!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/jiff/vendor/namshi/jose/src/Namshi/JOSE/Signer/OpenSSL/   drwxr-xr-x
Free 13.13 GB of 57.97 GB (22.65%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     PublicKey.php (2.57 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Namshi\JOSE\Signer\OpenSSL;

use 
InvalidArgumentException;
use 
Namshi\JOSE\Signer\SignerInterface;
use 
RuntimeException;

/**
 * Class responsible to sign inputs with the a public key algorithm, after hashing it.
 */
abstract class PublicKey implements SignerInterface
{
    
/**
     * {@inheritdoc}
     */
    
public function sign($input$key$password null)
    {
        
$keyResource $this->getKeyResource($key$password);
        if (!
$this->supportsKey($keyResource)) {
            throw new 
InvalidArgumentException('Invalid key supplied.');
        }

        
$signature null;
        
openssl_sign($input$signature$keyResource$this->getHashingAlgorithm());

        return 
$signature;
    }

    
/**
     * {@inheritdoc}
     */
    
public function verify($key$signature$input)
    {
        
$keyResource $this->getKeyResource($key);
        if (!
$this->supportsKey($keyResource)) {
            throw new 
InvalidArgumentException('Invalid key supplied.');
        }

        
$result openssl_verify($input$signature$keyResource$this->getHashingAlgorithm());

        if (
$result === -1) {
            throw new 
RuntimeException('Unknown error during verification.');
        }

        return (bool) 
$result;
    }

    
/**
     * Converts a string representation of a key into an OpenSSL resource.
     *
     * @param string|resource $key
     * @param string          $password
     *
     * @return resource OpenSSL key resource
     */
    
protected function getKeyResource($key$password null)
    {
        if (
is_resource($key)) {
            return 
$key;
        }

        
$resource openssl_pkey_get_public($key) ?: openssl_pkey_get_private($key$password);
        if (
$resource === false) {
            throw new 
RuntimeException('Could not read key resource: ' openssl_error_string());
        }
        return 
$resource;
    }

    
/**
     * Check if the key is supported by this signer.
     *
     * @param resource $key Public or private key
     *
     * @return bool
     */
    
protected function supportsKey($key)
    {
        
// OpenSSL 0.9.8+
        
$keyDetails openssl_pkey_get_details($key);

        return isset(
$keyDetails['type']) ? $this->getSupportedPrivateKeyType() === $keyDetails['type'] : false;
    }

    
/**
     * Returns the hashing algorithm used in this signer.
     *
     * @return string
     */
    
abstract protected function getHashingAlgorithm();

    
/**
     * Returns the private key type supported in this signer.
     *
     * @return string
     */
    
abstract protected function getSupportedPrivateKeyType();
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0047 ]--