private function getOpenSslAlgorithm(string $algorithm) : int
    {
        switch ($algorithm) {
            case Algorithms::RSA_SHA256:
                return OPENSSL_ALGO_SHA256;
            case Algorithms::RSA_SHA384:
                return OPENSSL_ALGO_SHA384;
            case Algorithms::RSA_SHA512:
                return OPENSSL_ALGO_SHA512;
            default:
                throw new InvalidArgumentException("Algorithm \"$algorithm\" is not an OpenSSL algorithm");
        }
    }
private function getOpenSslAlgorithm(string $algorithm) : int
    {
        switch ($algorithm) {
            case Algorithms::RSA_SHA256:
                return OPENSSL_ALGO_SHA256;
            case Algorithms::RSA_SHA384:
                return OPENSSL_ALGO_SHA384;
            case Algorithms::RSA_SHA512:
                return OPENSSL_ALGO_SHA512;
            default:
                throw new InvalidArgumentException("Algorithm \"$algorithm\" is not an OpenSSL algorithm");
        }
    }
private function getOpenSslAlgorithm ( string $ algorithm ) : int { switch ( $ algorithm ) { case Algorithms :: RSA_SHA256 : return OPENSSL_ALGO_SHA256 ; case Algorithms :: RSA_SHA384 : return OPENSSL_ALGO_SHA384 ; case Algorithms :: RSA_SHA512 : return OPENSSL_ALGO_SHA512 ; default : throw new InvalidArgumentException ( "Algorithm \"$algorithm\" is not an OpenSSL algorithm" ) ; } }
Gets the OpenSSL Id for a algorithm

@param string $algorithm The algorithm whose OpenSSL Id we want
@return int The PHP Id for the algorithm
@throws InvalidArgumentException Thrown if the algorithm is not an OpenSSL algorithm
Gets the OpenSSL Id for a algorithm