public static function calculateSignature($consumerId, $privateKey, $requestUrl, $requestMethod, $timestamp=null)
    {
        if(is_null($timestamp) || !is_numeric($timestamp)){
            $timestamp = self::getMilliseconds();
        }

        /**
         * Append values into string for signing
         */
        $message = $consumerId."\n".$requestUrl."\n".strtoupper($requestMethod)."\n".$timestamp."\n";

        /**
         * Get RSA object for signing
         */
        $rsa = new RSA();
        $decodedPrivateKey = base64_decode($privateKey);
        $rsa->setPrivateKeyFormat(RSA::PRIVATE_FORMAT_PKCS8);
        $rsa->setPublicKeyFormat(RSA::PRIVATE_FORMAT_PKCS8);

        /**
         * Load private key
         */
        if($rsa->loadKey($decodedPrivateKey,RSA::PRIVATE_FORMAT_PKCS8)){
            /**
             * Make sure we use SHA256 for signing
             */
            $rsa->setHash('sha256');
            $rsa->setSignatureMode(RSA::SIGNATURE_PKCS1);
            $signed = $rsa->sign($message);

            /**
             * Return Base64 Encode generated signature
             */
            return base64_encode($signed);

        } else {
            throw new \Exception("Unable to load private key", 1446780146);
        }
    }