当前位置: 首页>>代码示例>>Java>>正文


Java SignedPreKeyEntity类代码示例

本文整理汇总了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)));
}
 
开发者ID:XecureIT,项目名称:PeSanKita-lib,代码行数:27,代码来源:PushServiceSocket.java

示例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;
}
 
开发者ID:toshiapp,项目名称:toshi-android-client,代码行数:17,代码来源:SignalBootstrap.java

示例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;
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-lib,代码行数:10,代码来源:PushServiceSocket.java

示例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;
}
 
开发者ID:XecureIT,项目名称:PeSanKita-lib,代码行数:9,代码来源:PreKeyState.java

示例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));
}
 
开发者ID:XecureIT,项目名称:PeSanKita-lib,代码行数:7,代码来源:PushServiceSocket.java

示例6: getSignedPreKey

import org.whispersystems.signalservice.api.push.SignedPreKeyEntity; //导入依赖的package包/类
public SignedPreKeyEntity getSignedPreKey() {
  return signedPreKey;
}
 
开发者ID:XecureIT,项目名称:PeSanKita-lib,代码行数:4,代码来源:PreKeyResponseItem.java

示例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();
}
 
开发者ID:toshiapp,项目名称:toshi-android-client,代码行数:51,代码来源:ChatService.java

示例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();
}
 
开发者ID:XecureIT,项目名称:PeSanKita-lib,代码行数:8,代码来源:SignalServiceAccountManager.java


注:本文中的org.whispersystems.signalservice.api.push.SignedPreKeyEntity类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。