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

@param ResponseInterface $response
@param SigningSecretKey $secretKey
@return ResponseInterface
Add an Ed25519 signature to an HTTP response object .