本文整理汇总了Java中org.whispersystems.signalservice.api.push.SignedPreKeyEntity类的典型用法代码示例。如果您正苦于以下问题:Java SignedPreKeyEntity类的具体用法?Java SignedPreKeyEntity怎么用?Java SignedPreKeyEntity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SignedPreKeyEntity类属于org.whispersystems.signalservice.api.push包,在下文中一共展示了SignedPreKeyEntity类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerPreKeys
import org.whispersystems.signalservice.api.push.SignedPreKeyEntity; //导入依赖的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: SignalBootstrap
import org.whispersystems.signalservice.api.push.SignedPreKeyEntity; //导入依赖的package包/类
public SignalBootstrap(
final List<PreKeyEntity> preKeys,
final PreKeyEntity lastResortKey,
final String password,
final int registrationId,
final String signalingKey,
final SignedPreKeyEntity signedPreKey,
final IdentityKey identityKey) {
this.preKeys = preKeys;
this.lastResortKey = lastResortKey;
this.password = password;
this.registrationId = registrationId;
this.signalingKey = signalingKey;
this.signedPreKey = signedPreKey;
this.identityKey = identityKey;
}
示例3: getCurrentSignedPreKey
import org.whispersystems.signalservice.api.push.SignedPreKeyEntity; //导入依赖的package包/类
public SignedPreKeyEntity getCurrentSignedPreKey() throws IOException {
try {
String responseText = makeRequest(SIGNED_PREKEY_PATH, "GET", null);
return JsonUtil.fromJson(responseText, SignedPreKeyEntity.class);
} catch (NotFoundException e) {
Log.w(TAG, e);
return null;
}
}
示例4: PreKeyState
import org.whispersystems.signalservice.api.push.SignedPreKeyEntity; //导入依赖的package包/类
public PreKeyState(List<PreKeyEntity> preKeys, PreKeyEntity lastResortKey,
SignedPreKeyEntity signedPreKey, IdentityKey identityKey)
{
this.preKeys = preKeys;
this.lastResortKey = lastResortKey;
this.signedPreKey = signedPreKey;
this.identityKey = identityKey;
}
示例5: setCurrentSignedPreKey
import org.whispersystems.signalservice.api.push.SignedPreKeyEntity; //导入依赖的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));
}
示例6: getSignedPreKey
import org.whispersystems.signalservice.api.push.SignedPreKeyEntity; //导入依赖的package包/类
public SignedPreKeyEntity getSignedPreKey() {
return signedPreKey;
}
示例7: registerKeysWithTimestamp
import org.whispersystems.signalservice.api.push.SignedPreKeyEntity; //导入依赖的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();
}
示例8: getSignedPreKey
import org.whispersystems.signalservice.api.push.SignedPreKeyEntity; //导入依赖的package包/类
/**
* @return The server's view of the client's current signed prekey.
* @throws IOException
*/
public SignedPreKeyEntity getSignedPreKey() throws IOException {
return this.pushServiceSocket.getCurrentSignedPreKey();
}