當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。