org.whispersystems.signalservice.internal.push.ReceiptCredentialResponseJson Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of signal-service-java Show documentation
Show all versions of signal-service-java Show documentation
Signal Service communication library for Java, unofficial fork
package org.whispersystems.signalservice.internal.push;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.signal.libsignal.zkgroup.InvalidInputException;
import org.signal.libsignal.zkgroup.receipts.ReceiptCredentialResponse;
import org.signal.core.util.Base64;
import java.io.IOException;
class ReceiptCredentialResponseJson {
private final ReceiptCredentialResponse receiptCredentialResponse;
ReceiptCredentialResponseJson(@JsonProperty("receiptCredentialResponse") String receiptCredentialResponse) {
ReceiptCredentialResponse response;
try {
response = new ReceiptCredentialResponse(Base64.decode(receiptCredentialResponse));
} catch (IOException | InvalidInputException e) {
response = null;
}
this.receiptCredentialResponse = response;
}
public ReceiptCredentialResponse getReceiptCredentialResponse() {
return receiptCredentialResponse;
}
}