public function decryptResponseWithSharedKey(
        ResponseInterface $response,
        SharedEncryptionKey $key
    ): ResponseInterface {
        $encrypted = Base64UrlSafe::decode((string) $response->getBody());
        return $response->withBody(
            $this->adapter->stringToStream(
                Simple::decrypt($encrypted, $key)
            )
        );
    }
public function decryptResponseWithSharedKey(
        ResponseInterface $response,
        SharedEncryptionKey $key
    ): ResponseInterface {
        $encrypted = Base64UrlSafe::decode((string) $response->getBody());
        return $response->withBody(
            $this->adapter->stringToStream(
                Simple::decrypt($encrypted, $key)
            )
        );
    }
public function decryptResponseWithSharedKey ( ResponseInterface $ response , SharedEncryptionKey $ key ) : ResponseInterface { $ encrypted = Base64UrlSafe :: decode ( ( string ) $ response -> getBody ( ) ) ; return $ response -> withBody ( $ this -> adapter -> stringToStream ( Simple :: decrypt ( $ encrypted , $ key ) ) ) ; }
Decrypt an HTTP response with a pre-shared key.

@param ResponseInterface $response
@param SharedEncryptionKey $key
@return ResponseInterface
Decrypt an HTTP response with a pre - shared key .