本文整理汇总了Java中org.whispersystems.libsignal.state.SignedPreKeyRecord.getId方法的典型用法代码示例。如果您正苦于以下问题:Java SignedPreKeyRecord.getId方法的具体用法?Java SignedPreKeyRecord.getId怎么用?Java SignedPreKeyRecord.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.whispersystems.libsignal.state.SignedPreKeyRecord
的用法示例。
在下文中一共展示了SignedPreKeyRecord.getId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerPreKeys
import org.whispersystems.libsignal.state.SignedPreKeyRecord; //导入方法依赖的package包/类
public void registerPreKeys(IdentityKey identityKey,
PreKeyRecord lastResortKey,
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);
}
PreKeyEntity lastResortEntity = new PreKeyEntity(lastResortKey.getId(),
lastResortKey.getKeyPair().getPublicKey());
SignedPreKeyEntity signedPreKeyEntity = new SignedPreKeyEntity(signedPreKey.getId(),
signedPreKey.getKeyPair().getPublicKey(),
signedPreKey.getSignature());
makeRequest(String.format(PREKEY_PATH, ""), "PUT",
JsonUtil.toJson(new PreKeyState(entities, lastResortEntity,
signedPreKeyEntity, identityKey)));
}
示例2: removeRecordFrom
import org.whispersystems.libsignal.state.SignedPreKeyRecord; //导入方法依赖的package包/类
private LinkedList<SignedPreKeyRecord> removeRecordFrom(SignedPreKeyRecord currentRecord,
List<SignedPreKeyRecord> records)
{
LinkedList<SignedPreKeyRecord> others = new LinkedList<>();
for (SignedPreKeyRecord record : records) {
if (record.getId() != currentRecord.getId()) {
others.add(record);
}
}
return others;
}
示例3: setCurrentSignedPreKey
import org.whispersystems.libsignal.state.SignedPreKeyRecord; //导入方法依赖的package包/类
public void setCurrentSignedPreKey(SignedPreKeyRecord signedPreKey) throws IOException {
SignedPreKeyEntity signedPreKeyEntity = new SignedPreKeyEntity(signedPreKey.getId(),
signedPreKey.getKeyPair().getPublicKey(),
signedPreKey.getSignature());
makeRequest(SIGNED_PREKEY_PATH, "PUT", JsonUtil.toJson(signedPreKeyEntity));
}
示例4: registerKeysWithTimestamp
import org.whispersystems.libsignal.state.SignedPreKeyRecord; //导入方法依赖的package包/类
private Completable registerKeysWithTimestamp(
final long timestamp,
final IdentityKey identityKey,
final PreKeyRecord lastResortKey,
final String password,
final int registrationId,
final String signalingKey,
final SignedPreKeyRecord signedPreKey,
final List<PreKeyRecord> preKeys) {
final long startTime = System.currentTimeMillis();
final List<PreKeyEntity> entities = new LinkedList<>();
for (PreKeyRecord preKey : preKeys) {
final PreKeyEntity entity = new PreKeyEntity(
preKey.getId(),
preKey.getKeyPair().getPublicKey());
entities.add(entity);
}
final PreKeyEntity lastResortEntity = new PreKeyEntity(
lastResortKey.getId(),
lastResortKey.getKeyPair().getPublicKey());
final SignedPreKeyEntity signedPreKeyEntity = new SignedPreKeyEntity(
signedPreKey.getId(),
signedPreKey.getKeyPair().getPublicKey(),
signedPreKey.getSignature());
final long endTime = System.currentTimeMillis();
final long elapsedSeconds = (endTime - startTime) / 1000;
final long amendedTimestamp = timestamp + elapsedSeconds;
final SignalBootstrap payload = new SignalBootstrap(
entities,
lastResortEntity,
password,
registrationId,
signalingKey,
signedPreKeyEntity,
identityKey);
final String payloadForSigning = JsonUtil.toJson(payload);
return this.chatInterface
.register(payloadForSigning, amendedTimestamp)
.observeOn(Schedulers.io())
.subscribeOn(Schedulers.io())
.toCompletable();
}