public function signRequest(
        RequestInterface $request,
        SigningSecretKey $secretKey
    ): RequestInterface {
        $signature = \ParagonIE_Sodium_Compat::crypto_sign_detached(
            (string) $request->getBody(),
            $secretKey->getString(true)
        );
        return $request->withAddedHeader(
            (string) static::HEADER_SIGNATURE_NAME,
            Base64UrlSafe::encode($signature)
        );
    }
public function signRequest(
        RequestInterface $request,
        SigningSecretKey $secretKey
    ): RequestInterface {
        $signature = \ParagonIE_Sodium_Compat::crypto_sign_detached(
            (string) $request->getBody(),
            $secretKey->getString(true)
        );
        return $request->withAddedHeader(
            (string) static::HEADER_SIGNATURE_NAME,
            Base64UrlSafe::encode($signature)
        );
    }
public function signRequest ( RequestInterface $ request , SigningSecretKey $ secretKey ) : RequestInterface { $ signature = \ ParagonIE_Sodium_Compat :: crypto_sign_detached ( ( string ) $ request -> getBody ( ) , $ secretKey -> getString ( true ) ) ; return $ request -> withAddedHeader ( ( string ) static :: HEADER_SIGNATURE_NAME , Base64UrlSafe :: encode ( $ signature ) ) ; }
Add an Ed25519 signature to an HTTP request object.

@param RequestInterface $request
@param SigningSecretKey $secretKey
@return RequestInterface
Add an Ed25519 signature to an HTTP request object .