request->getPathParam('token'); $request = $this->secretService->retrieveAndDeleteFulfillment($token); if ($request === null) { $this->httpStatusCode = Http::NOT_FOUND; return $this->showErrorMessage('Not found'); } $this->notifyStatusChanged($token, SecretService::STATUS_RETRIEVED); $response = [ 'filler_pub' => Base64Url::encode((string) $request->getFillerPub()), 'ciphertext' => Base64Url::encode((string) $request->getCiphertext()), 'nonce' => Base64Url::encode((string) $request->getNonce()), ]; $attachmentCiphertext = $request->getAttachmentCiphertext(); $attachmentNonce = $request->getAttachmentNonce(); $attachmentMeta = $request->getAttachmentMeta(); if ($attachmentCiphertext !== null && $attachmentNonce !== null && $attachmentMeta !== null) { $response['attachment_ciphertext'] = Base64Url::encode($attachmentCiphertext); $response['attachment_nonce'] = Base64Url::encode($attachmentNonce); $response['attachment_meta'] = Base64Url::encode($attachmentMeta); } return $response; } catch (Throwable $e) { $this->secretLogger->logException($e); return $this->showErrorMessage('Unable to retrieve fulfillment'); } } }