Files
Android/library/src/org/whispersystems/textsecure/crypto/protocol/WhisperProtos.java
Moxie Marlinspike 3999171377 Introduce registration-time ID for detecting stale sessions.
1) At registration time, a client generates a random ID and
   transmits to the the server.

2) The server provides that registration ID to any client
   that requests a prekey.

3) Clients include that registration ID in any
   PreKeyWhisperMessage.

4) Clients include that registration ID in their sendMessage
   API call to the server.

5) The server verifies that the registration ID included in
   an API call is the same as the current registration ID
   for the destination device.  Otherwise, it notifies the
   sender that their session is stale.
2014-02-18 12:51:23 -08:00

1695 lines
63 KiB
Java

// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: WhisperTextProtocol.proto
package org.whispersystems.textsecure.crypto.protocol;
public final class WhisperProtos {
private WhisperProtos() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface WhisperMessageOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// optional bytes ephemeralKey = 1;
boolean hasEphemeralKey();
com.google.protobuf.ByteString getEphemeralKey();
// optional uint32 counter = 2;
boolean hasCounter();
int getCounter();
// optional uint32 previousCounter = 3;
boolean hasPreviousCounter();
int getPreviousCounter();
// optional bytes ciphertext = 4;
boolean hasCiphertext();
com.google.protobuf.ByteString getCiphertext();
}
public static final class WhisperMessage extends
com.google.protobuf.GeneratedMessage
implements WhisperMessageOrBuilder {
// Use WhisperMessage.newBuilder() to construct.
private WhisperMessage(Builder builder) {
super(builder);
}
private WhisperMessage(boolean noInit) {}
private static final WhisperMessage defaultInstance;
public static WhisperMessage getDefaultInstance() {
return defaultInstance;
}
public WhisperMessage getDefaultInstanceForType() {
return defaultInstance;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.internal_static_textsecure_WhisperMessage_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.internal_static_textsecure_WhisperMessage_fieldAccessorTable;
}
private int bitField0_;
// optional bytes ephemeralKey = 1;
public static final int EPHEMERALKEY_FIELD_NUMBER = 1;
private com.google.protobuf.ByteString ephemeralKey_;
public boolean hasEphemeralKey() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public com.google.protobuf.ByteString getEphemeralKey() {
return ephemeralKey_;
}
// optional uint32 counter = 2;
public static final int COUNTER_FIELD_NUMBER = 2;
private int counter_;
public boolean hasCounter() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public int getCounter() {
return counter_;
}
// optional uint32 previousCounter = 3;
public static final int PREVIOUSCOUNTER_FIELD_NUMBER = 3;
private int previousCounter_;
public boolean hasPreviousCounter() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public int getPreviousCounter() {
return previousCounter_;
}
// optional bytes ciphertext = 4;
public static final int CIPHERTEXT_FIELD_NUMBER = 4;
private com.google.protobuf.ByteString ciphertext_;
public boolean hasCiphertext() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
public com.google.protobuf.ByteString getCiphertext() {
return ciphertext_;
}
private void initFields() {
ephemeralKey_ = com.google.protobuf.ByteString.EMPTY;
counter_ = 0;
previousCounter_ = 0;
ciphertext_ = com.google.protobuf.ByteString.EMPTY;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, ephemeralKey_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeUInt32(2, counter_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeUInt32(3, previousCounter_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeBytes(4, ciphertext_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, ephemeralKey_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(2, counter_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(3, previousCounter_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(4, ciphertext_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage parseFrom(java.io.InputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input)) {
return builder.buildParsed();
} else {
return null;
}
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
return builder.buildParsed();
} else {
return null;
}
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessageOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.internal_static_textsecure_WhisperMessage_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.internal_static_textsecure_WhisperMessage_fieldAccessorTable;
}
// Construct using org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
ephemeralKey_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
counter_ = 0;
bitField0_ = (bitField0_ & ~0x00000002);
previousCounter_ = 0;
bitField0_ = (bitField0_ & ~0x00000004);
ciphertext_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000008);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage.getDescriptor();
}
public org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage getDefaultInstanceForType() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage.getDefaultInstance();
}
public org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage build() {
org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
private org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return result;
}
public org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage buildPartial() {
org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage result = new org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.ephemeralKey_ = ephemeralKey_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.counter_ = counter_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.previousCounter_ = previousCounter_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.ciphertext_ = ciphertext_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage) {
return mergeFrom((org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage other) {
if (other == org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage.getDefaultInstance()) return this;
if (other.hasEphemeralKey()) {
setEphemeralKey(other.getEphemeralKey());
}
if (other.hasCounter()) {
setCounter(other.getCounter());
}
if (other.hasPreviousCounter()) {
setPreviousCounter(other.getPreviousCounter());
}
if (other.hasCiphertext()) {
setCiphertext(other.getCiphertext());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder(
this.getUnknownFields());
while (true) {
int tag = input.readTag();
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
}
break;
}
case 10: {
bitField0_ |= 0x00000001;
ephemeralKey_ = input.readBytes();
break;
}
case 16: {
bitField0_ |= 0x00000002;
counter_ = input.readUInt32();
break;
}
case 24: {
bitField0_ |= 0x00000004;
previousCounter_ = input.readUInt32();
break;
}
case 34: {
bitField0_ |= 0x00000008;
ciphertext_ = input.readBytes();
break;
}
}
}
}
private int bitField0_;
// optional bytes ephemeralKey = 1;
private com.google.protobuf.ByteString ephemeralKey_ = com.google.protobuf.ByteString.EMPTY;
public boolean hasEphemeralKey() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public com.google.protobuf.ByteString getEphemeralKey() {
return ephemeralKey_;
}
public Builder setEphemeralKey(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
ephemeralKey_ = value;
onChanged();
return this;
}
public Builder clearEphemeralKey() {
bitField0_ = (bitField0_ & ~0x00000001);
ephemeralKey_ = getDefaultInstance().getEphemeralKey();
onChanged();
return this;
}
// optional uint32 counter = 2;
private int counter_ ;
public boolean hasCounter() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public int getCounter() {
return counter_;
}
public Builder setCounter(int value) {
bitField0_ |= 0x00000002;
counter_ = value;
onChanged();
return this;
}
public Builder clearCounter() {
bitField0_ = (bitField0_ & ~0x00000002);
counter_ = 0;
onChanged();
return this;
}
// optional uint32 previousCounter = 3;
private int previousCounter_ ;
public boolean hasPreviousCounter() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public int getPreviousCounter() {
return previousCounter_;
}
public Builder setPreviousCounter(int value) {
bitField0_ |= 0x00000004;
previousCounter_ = value;
onChanged();
return this;
}
public Builder clearPreviousCounter() {
bitField0_ = (bitField0_ & ~0x00000004);
previousCounter_ = 0;
onChanged();
return this;
}
// optional bytes ciphertext = 4;
private com.google.protobuf.ByteString ciphertext_ = com.google.protobuf.ByteString.EMPTY;
public boolean hasCiphertext() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
public com.google.protobuf.ByteString getCiphertext() {
return ciphertext_;
}
public Builder setCiphertext(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
ciphertext_ = value;
onChanged();
return this;
}
public Builder clearCiphertext() {
bitField0_ = (bitField0_ & ~0x00000008);
ciphertext_ = getDefaultInstance().getCiphertext();
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:textsecure.WhisperMessage)
}
static {
defaultInstance = new WhisperMessage(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:textsecure.WhisperMessage)
}
public interface PreKeyWhisperMessageOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// optional uint32 registrationId = 5;
boolean hasRegistrationId();
int getRegistrationId();
// optional uint32 preKeyId = 1;
boolean hasPreKeyId();
int getPreKeyId();
// optional bytes baseKey = 2;
boolean hasBaseKey();
com.google.protobuf.ByteString getBaseKey();
// optional bytes identityKey = 3;
boolean hasIdentityKey();
com.google.protobuf.ByteString getIdentityKey();
// optional bytes message = 4;
boolean hasMessage();
com.google.protobuf.ByteString getMessage();
}
public static final class PreKeyWhisperMessage extends
com.google.protobuf.GeneratedMessage
implements PreKeyWhisperMessageOrBuilder {
// Use PreKeyWhisperMessage.newBuilder() to construct.
private PreKeyWhisperMessage(Builder builder) {
super(builder);
}
private PreKeyWhisperMessage(boolean noInit) {}
private static final PreKeyWhisperMessage defaultInstance;
public static PreKeyWhisperMessage getDefaultInstance() {
return defaultInstance;
}
public PreKeyWhisperMessage getDefaultInstanceForType() {
return defaultInstance;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.internal_static_textsecure_PreKeyWhisperMessage_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.internal_static_textsecure_PreKeyWhisperMessage_fieldAccessorTable;
}
private int bitField0_;
// optional uint32 registrationId = 5;
public static final int REGISTRATIONID_FIELD_NUMBER = 5;
private int registrationId_;
public boolean hasRegistrationId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public int getRegistrationId() {
return registrationId_;
}
// optional uint32 preKeyId = 1;
public static final int PREKEYID_FIELD_NUMBER = 1;
private int preKeyId_;
public boolean hasPreKeyId() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public int getPreKeyId() {
return preKeyId_;
}
// optional bytes baseKey = 2;
public static final int BASEKEY_FIELD_NUMBER = 2;
private com.google.protobuf.ByteString baseKey_;
public boolean hasBaseKey() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public com.google.protobuf.ByteString getBaseKey() {
return baseKey_;
}
// optional bytes identityKey = 3;
public static final int IDENTITYKEY_FIELD_NUMBER = 3;
private com.google.protobuf.ByteString identityKey_;
public boolean hasIdentityKey() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
public com.google.protobuf.ByteString getIdentityKey() {
return identityKey_;
}
// optional bytes message = 4;
public static final int MESSAGE_FIELD_NUMBER = 4;
private com.google.protobuf.ByteString message_;
public boolean hasMessage() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
public com.google.protobuf.ByteString getMessage() {
return message_;
}
private void initFields() {
registrationId_ = 0;
preKeyId_ = 0;
baseKey_ = com.google.protobuf.ByteString.EMPTY;
identityKey_ = com.google.protobuf.ByteString.EMPTY;
message_ = com.google.protobuf.ByteString.EMPTY;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeUInt32(1, preKeyId_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeBytes(2, baseKey_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeBytes(3, identityKey_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeBytes(4, message_);
}
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeUInt32(5, registrationId_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(1, preKeyId_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, baseKey_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, identityKey_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(4, message_);
}
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(5, registrationId_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage parseFrom(java.io.InputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input)) {
return builder.buildParsed();
} else {
return null;
}
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
return builder.buildParsed();
} else {
return null;
}
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessageOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.internal_static_textsecure_PreKeyWhisperMessage_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.internal_static_textsecure_PreKeyWhisperMessage_fieldAccessorTable;
}
// Construct using org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
registrationId_ = 0;
bitField0_ = (bitField0_ & ~0x00000001);
preKeyId_ = 0;
bitField0_ = (bitField0_ & ~0x00000002);
baseKey_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000004);
identityKey_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000008);
message_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000010);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage.getDescriptor();
}
public org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage getDefaultInstanceForType() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage.getDefaultInstance();
}
public org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage build() {
org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
private org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return result;
}
public org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage buildPartial() {
org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage result = new org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.registrationId_ = registrationId_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.preKeyId_ = preKeyId_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.baseKey_ = baseKey_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.identityKey_ = identityKey_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
result.message_ = message_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage) {
return mergeFrom((org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage other) {
if (other == org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage.getDefaultInstance()) return this;
if (other.hasRegistrationId()) {
setRegistrationId(other.getRegistrationId());
}
if (other.hasPreKeyId()) {
setPreKeyId(other.getPreKeyId());
}
if (other.hasBaseKey()) {
setBaseKey(other.getBaseKey());
}
if (other.hasIdentityKey()) {
setIdentityKey(other.getIdentityKey());
}
if (other.hasMessage()) {
setMessage(other.getMessage());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder(
this.getUnknownFields());
while (true) {
int tag = input.readTag();
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
}
break;
}
case 8: {
bitField0_ |= 0x00000002;
preKeyId_ = input.readUInt32();
break;
}
case 18: {
bitField0_ |= 0x00000004;
baseKey_ = input.readBytes();
break;
}
case 26: {
bitField0_ |= 0x00000008;
identityKey_ = input.readBytes();
break;
}
case 34: {
bitField0_ |= 0x00000010;
message_ = input.readBytes();
break;
}
case 40: {
bitField0_ |= 0x00000001;
registrationId_ = input.readUInt32();
break;
}
}
}
}
private int bitField0_;
// optional uint32 registrationId = 5;
private int registrationId_ ;
public boolean hasRegistrationId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public int getRegistrationId() {
return registrationId_;
}
public Builder setRegistrationId(int value) {
bitField0_ |= 0x00000001;
registrationId_ = value;
onChanged();
return this;
}
public Builder clearRegistrationId() {
bitField0_ = (bitField0_ & ~0x00000001);
registrationId_ = 0;
onChanged();
return this;
}
// optional uint32 preKeyId = 1;
private int preKeyId_ ;
public boolean hasPreKeyId() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public int getPreKeyId() {
return preKeyId_;
}
public Builder setPreKeyId(int value) {
bitField0_ |= 0x00000002;
preKeyId_ = value;
onChanged();
return this;
}
public Builder clearPreKeyId() {
bitField0_ = (bitField0_ & ~0x00000002);
preKeyId_ = 0;
onChanged();
return this;
}
// optional bytes baseKey = 2;
private com.google.protobuf.ByteString baseKey_ = com.google.protobuf.ByteString.EMPTY;
public boolean hasBaseKey() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public com.google.protobuf.ByteString getBaseKey() {
return baseKey_;
}
public Builder setBaseKey(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
baseKey_ = value;
onChanged();
return this;
}
public Builder clearBaseKey() {
bitField0_ = (bitField0_ & ~0x00000004);
baseKey_ = getDefaultInstance().getBaseKey();
onChanged();
return this;
}
// optional bytes identityKey = 3;
private com.google.protobuf.ByteString identityKey_ = com.google.protobuf.ByteString.EMPTY;
public boolean hasIdentityKey() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
public com.google.protobuf.ByteString getIdentityKey() {
return identityKey_;
}
public Builder setIdentityKey(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
identityKey_ = value;
onChanged();
return this;
}
public Builder clearIdentityKey() {
bitField0_ = (bitField0_ & ~0x00000008);
identityKey_ = getDefaultInstance().getIdentityKey();
onChanged();
return this;
}
// optional bytes message = 4;
private com.google.protobuf.ByteString message_ = com.google.protobuf.ByteString.EMPTY;
public boolean hasMessage() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
public com.google.protobuf.ByteString getMessage() {
return message_;
}
public Builder setMessage(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
message_ = value;
onChanged();
return this;
}
public Builder clearMessage() {
bitField0_ = (bitField0_ & ~0x00000010);
message_ = getDefaultInstance().getMessage();
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:textsecure.PreKeyWhisperMessage)
}
static {
defaultInstance = new PreKeyWhisperMessage(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:textsecure.PreKeyWhisperMessage)
}
public interface KeyExchangeMessageOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// optional uint32 id = 1;
boolean hasId();
int getId();
// optional bytes baseKey = 2;
boolean hasBaseKey();
com.google.protobuf.ByteString getBaseKey();
// optional bytes ephemeralKey = 3;
boolean hasEphemeralKey();
com.google.protobuf.ByteString getEphemeralKey();
// optional bytes identityKey = 4;
boolean hasIdentityKey();
com.google.protobuf.ByteString getIdentityKey();
}
public static final class KeyExchangeMessage extends
com.google.protobuf.GeneratedMessage
implements KeyExchangeMessageOrBuilder {
// Use KeyExchangeMessage.newBuilder() to construct.
private KeyExchangeMessage(Builder builder) {
super(builder);
}
private KeyExchangeMessage(boolean noInit) {}
private static final KeyExchangeMessage defaultInstance;
public static KeyExchangeMessage getDefaultInstance() {
return defaultInstance;
}
public KeyExchangeMessage getDefaultInstanceForType() {
return defaultInstance;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.internal_static_textsecure_KeyExchangeMessage_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.internal_static_textsecure_KeyExchangeMessage_fieldAccessorTable;
}
private int bitField0_;
// optional uint32 id = 1;
public static final int ID_FIELD_NUMBER = 1;
private int id_;
public boolean hasId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public int getId() {
return id_;
}
// optional bytes baseKey = 2;
public static final int BASEKEY_FIELD_NUMBER = 2;
private com.google.protobuf.ByteString baseKey_;
public boolean hasBaseKey() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public com.google.protobuf.ByteString getBaseKey() {
return baseKey_;
}
// optional bytes ephemeralKey = 3;
public static final int EPHEMERALKEY_FIELD_NUMBER = 3;
private com.google.protobuf.ByteString ephemeralKey_;
public boolean hasEphemeralKey() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public com.google.protobuf.ByteString getEphemeralKey() {
return ephemeralKey_;
}
// optional bytes identityKey = 4;
public static final int IDENTITYKEY_FIELD_NUMBER = 4;
private com.google.protobuf.ByteString identityKey_;
public boolean hasIdentityKey() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
public com.google.protobuf.ByteString getIdentityKey() {
return identityKey_;
}
private void initFields() {
id_ = 0;
baseKey_ = com.google.protobuf.ByteString.EMPTY;
ephemeralKey_ = com.google.protobuf.ByteString.EMPTY;
identityKey_ = com.google.protobuf.ByteString.EMPTY;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeUInt32(1, id_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, baseKey_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeBytes(3, ephemeralKey_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeBytes(4, identityKey_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(1, id_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, baseKey_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, ephemeralKey_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(4, identityKey_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage parseFrom(java.io.InputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input)) {
return builder.buildParsed();
} else {
return null;
}
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
return builder.buildParsed();
} else {
return null;
}
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessageOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.internal_static_textsecure_KeyExchangeMessage_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.internal_static_textsecure_KeyExchangeMessage_fieldAccessorTable;
}
// Construct using org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
id_ = 0;
bitField0_ = (bitField0_ & ~0x00000001);
baseKey_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000002);
ephemeralKey_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000004);
identityKey_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000008);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage.getDescriptor();
}
public org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage getDefaultInstanceForType() {
return org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage.getDefaultInstance();
}
public org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage build() {
org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
private org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return result;
}
public org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage buildPartial() {
org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage result = new org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.id_ = id_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.baseKey_ = baseKey_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.ephemeralKey_ = ephemeralKey_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.identityKey_ = identityKey_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage) {
return mergeFrom((org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage other) {
if (other == org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage.getDefaultInstance()) return this;
if (other.hasId()) {
setId(other.getId());
}
if (other.hasBaseKey()) {
setBaseKey(other.getBaseKey());
}
if (other.hasEphemeralKey()) {
setEphemeralKey(other.getEphemeralKey());
}
if (other.hasIdentityKey()) {
setIdentityKey(other.getIdentityKey());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder(
this.getUnknownFields());
while (true) {
int tag = input.readTag();
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
id_ = input.readUInt32();
break;
}
case 18: {
bitField0_ |= 0x00000002;
baseKey_ = input.readBytes();
break;
}
case 26: {
bitField0_ |= 0x00000004;
ephemeralKey_ = input.readBytes();
break;
}
case 34: {
bitField0_ |= 0x00000008;
identityKey_ = input.readBytes();
break;
}
}
}
}
private int bitField0_;
// optional uint32 id = 1;
private int id_ ;
public boolean hasId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public int getId() {
return id_;
}
public Builder setId(int value) {
bitField0_ |= 0x00000001;
id_ = value;
onChanged();
return this;
}
public Builder clearId() {
bitField0_ = (bitField0_ & ~0x00000001);
id_ = 0;
onChanged();
return this;
}
// optional bytes baseKey = 2;
private com.google.protobuf.ByteString baseKey_ = com.google.protobuf.ByteString.EMPTY;
public boolean hasBaseKey() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public com.google.protobuf.ByteString getBaseKey() {
return baseKey_;
}
public Builder setBaseKey(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
baseKey_ = value;
onChanged();
return this;
}
public Builder clearBaseKey() {
bitField0_ = (bitField0_ & ~0x00000002);
baseKey_ = getDefaultInstance().getBaseKey();
onChanged();
return this;
}
// optional bytes ephemeralKey = 3;
private com.google.protobuf.ByteString ephemeralKey_ = com.google.protobuf.ByteString.EMPTY;
public boolean hasEphemeralKey() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public com.google.protobuf.ByteString getEphemeralKey() {
return ephemeralKey_;
}
public Builder setEphemeralKey(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
ephemeralKey_ = value;
onChanged();
return this;
}
public Builder clearEphemeralKey() {
bitField0_ = (bitField0_ & ~0x00000004);
ephemeralKey_ = getDefaultInstance().getEphemeralKey();
onChanged();
return this;
}
// optional bytes identityKey = 4;
private com.google.protobuf.ByteString identityKey_ = com.google.protobuf.ByteString.EMPTY;
public boolean hasIdentityKey() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
public com.google.protobuf.ByteString getIdentityKey() {
return identityKey_;
}
public Builder setIdentityKey(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
identityKey_ = value;
onChanged();
return this;
}
public Builder clearIdentityKey() {
bitField0_ = (bitField0_ & ~0x00000008);
identityKey_ = getDefaultInstance().getIdentityKey();
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:textsecure.KeyExchangeMessage)
}
static {
defaultInstance = new KeyExchangeMessage(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:textsecure.KeyExchangeMessage)
}
private static com.google.protobuf.Descriptors.Descriptor
internal_static_textsecure_WhisperMessage_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_textsecure_WhisperMessage_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_textsecure_PreKeyWhisperMessage_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_textsecure_PreKeyWhisperMessage_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_textsecure_KeyExchangeMessage_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_textsecure_KeyExchangeMessage_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\031WhisperTextProtocol.proto\022\ntextsecure\"" +
"d\n\016WhisperMessage\022\024\n\014ephemeralKey\030\001 \001(\014\022" +
"\017\n\007counter\030\002 \001(\r\022\027\n\017previousCounter\030\003 \001(" +
"\r\022\022\n\nciphertext\030\004 \001(\014\"w\n\024PreKeyWhisperMe" +
"ssage\022\026\n\016registrationId\030\005 \001(\r\022\020\n\010preKeyI" +
"d\030\001 \001(\r\022\017\n\007baseKey\030\002 \001(\014\022\023\n\013identityKey\030" +
"\003 \001(\014\022\017\n\007message\030\004 \001(\014\"\\\n\022KeyExchangeMes" +
"sage\022\n\n\002id\030\001 \001(\r\022\017\n\007baseKey\030\002 \001(\014\022\024\n\014eph" +
"emeralKey\030\003 \001(\014\022\023\n\013identityKey\030\004 \001(\014B>\n-" +
"org.whispersystems.textsecure.crypto.pro",
"tocolB\rWhisperProtos"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
internal_static_textsecure_WhisperMessage_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_textsecure_WhisperMessage_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_textsecure_WhisperMessage_descriptor,
new java.lang.String[] { "EphemeralKey", "Counter", "PreviousCounter", "Ciphertext", },
org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage.class,
org.whispersystems.textsecure.crypto.protocol.WhisperProtos.WhisperMessage.Builder.class);
internal_static_textsecure_PreKeyWhisperMessage_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_textsecure_PreKeyWhisperMessage_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_textsecure_PreKeyWhisperMessage_descriptor,
new java.lang.String[] { "RegistrationId", "PreKeyId", "BaseKey", "IdentityKey", "Message", },
org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage.class,
org.whispersystems.textsecure.crypto.protocol.WhisperProtos.PreKeyWhisperMessage.Builder.class);
internal_static_textsecure_KeyExchangeMessage_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_textsecure_KeyExchangeMessage_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_textsecure_KeyExchangeMessage_descriptor,
new java.lang.String[] { "Id", "BaseKey", "EphemeralKey", "IdentityKey", },
org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage.class,
org.whispersystems.textsecure.crypto.protocol.WhisperProtos.KeyExchangeMessage.Builder.class);
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
}
// @@protoc_insertion_point(outer_class_scope)
}