use of org.whispersystems.signalservice.api.push.SignedPreKeyEntity in project Signal-Android by WhisperSystems.
the class PushServiceSocket method registerPreKeys.
public void registerPreKeys(ServiceIdType serviceIdType, IdentityKey identityKey, SignedPreKeyRecord signedPreKey, List<PreKeyRecord> records) throws IOException {
List<PreKeyEntity> entities = new LinkedList<>();
for (PreKeyRecord record : records) {
PreKeyEntity entity = new PreKeyEntity(record.getId(), record.getKeyPair().getPublicKey());
entities.add(entity);
}
SignedPreKeyEntity signedPreKeyEntity = new SignedPreKeyEntity(signedPreKey.getId(), signedPreKey.getKeyPair().getPublicKey(), signedPreKey.getSignature());
makeServiceRequest(String.format(Locale.US, PREKEY_PATH, "", serviceIdType.queryParam()), "PUT", JsonUtil.toJson(new PreKeyState(entities, signedPreKeyEntity, identityKey)));
}
use of org.whispersystems.signalservice.api.push.SignedPreKeyEntity in project Signal-Android by WhisperSystems.
the class PushServiceSocket method setCurrentSignedPreKey.
public void setCurrentSignedPreKey(ServiceIdType serviceIdType, SignedPreKeyRecord signedPreKey) throws IOException {
String path = String.format(SIGNED_PREKEY_PATH, serviceIdType.queryParam());
SignedPreKeyEntity signedPreKeyEntity = new SignedPreKeyEntity(signedPreKey.getId(), signedPreKey.getKeyPair().getPublicKey(), signedPreKey.getSignature());
makeServiceRequest(path, "PUT", JsonUtil.toJson(signedPreKeyEntity));
}
use of org.whispersystems.signalservice.api.push.SignedPreKeyEntity in project libsignal-service-java by signalapp.
the class PushServiceSocket method registerPreKeys.
public void registerPreKeys(IdentityKey identityKey, SignedPreKeyRecord signedPreKey, List<PreKeyRecord> records) throws IOException {
List<PreKeyEntity> entities = new LinkedList<>();
for (PreKeyRecord record : records) {
PreKeyEntity entity = new PreKeyEntity(record.getId(), record.getKeyPair().getPublicKey());
entities.add(entity);
}
SignedPreKeyEntity signedPreKeyEntity = new SignedPreKeyEntity(signedPreKey.getId(), signedPreKey.getKeyPair().getPublicKey(), signedPreKey.getSignature());
makeServiceRequest(String.format(PREKEY_PATH, ""), "PUT", JsonUtil.toJson(new PreKeyState(entities, signedPreKeyEntity, identityKey)));
}
use of org.whispersystems.signalservice.api.push.SignedPreKeyEntity in project libsignal-service-java by signalapp.
the class PushServiceSocket method setCurrentSignedPreKey.
public void setCurrentSignedPreKey(SignedPreKeyRecord signedPreKey) throws IOException {
SignedPreKeyEntity signedPreKeyEntity = new SignedPreKeyEntity(signedPreKey.getId(), signedPreKey.getKeyPair().getPublicKey(), signedPreKey.getSignature());
makeServiceRequest(SIGNED_PREKEY_PATH, "PUT", JsonUtil.toJson(signedPreKeyEntity));
}
use of org.whispersystems.signalservice.api.push.SignedPreKeyEntity in project Signal-Android by signalapp.
the class PushServiceSocket method setCurrentSignedPreKey.
public void setCurrentSignedPreKey(ServiceIdType serviceIdType, SignedPreKeyRecord signedPreKey) throws IOException {
String path = String.format(SIGNED_PREKEY_PATH, serviceIdType.queryParam());
SignedPreKeyEntity signedPreKeyEntity = new SignedPreKeyEntity(signedPreKey.getId(), signedPreKey.getKeyPair().getPublicKey(), signedPreKey.getSignature());
makeServiceRequest(path, "PUT", JsonUtil.toJson(signedPreKeyEntity));
}
Aggregations