org.signal.cdsi.proto.ClientHandshakeStart.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of signal-service-java Show documentation
Show all versions of signal-service-java Show documentation
Signal Service communication library for Java, unofficial fork
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: org.signal.cdsi.ClientHandshakeStart in CDSI.proto
package org.signal.cdsi.proto
import com.squareup.wire.FieldEncoding
import com.squareup.wire.Message
import com.squareup.wire.ProtoAdapter
import com.squareup.wire.ProtoReader
import com.squareup.wire.ProtoWriter
import com.squareup.wire.ReverseProtoWriter
import com.squareup.wire.Syntax.PROTO_3
import com.squareup.wire.WireField
import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Unit
import kotlin.jvm.JvmField
import okio.ByteString
public class ClientHandshakeStart(
/**
* Public key associated with this server's enclave. For use in test-only
* contexts where attestation is not available
*/
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#BYTES",
label = WireField.Label.OMIT_IDENTITY,
)
@JvmField
public val testonlyPubkey: ByteString = ByteString.EMPTY,
/**
* Remote-attestation evidence associated with the public key
*/
@field:WireField(
tag = 2,
adapter = "com.squareup.wire.ProtoAdapter#BYTES",
label = WireField.Label.OMIT_IDENTITY,
)
@JvmField
public val evidence: ByteString = ByteString.EMPTY,
/**
* Endorsements of remote-attestation evidence.
*/
@field:WireField(
tag = 3,
adapter = "com.squareup.wire.ProtoAdapter#BYTES",
label = WireField.Label.OMIT_IDENTITY,
)
@JvmField
public val endorsement: ByteString = ByteString.EMPTY,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
public override fun newBuilder(): Builder {
val builder = Builder()
builder.testonlyPubkey = testonlyPubkey
builder.evidence = evidence
builder.endorsement = endorsement
builder.addUnknownFields(unknownFields)
return builder
}
public override fun equals(other: Any?): Boolean {
if (other === this) return true
if (other !is ClientHandshakeStart) return false
if (unknownFields != other.unknownFields) return false
if (testonlyPubkey != other.testonlyPubkey) return false
if (evidence != other.evidence) return false
if (endorsement != other.endorsement) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + testonlyPubkey.hashCode()
result = result * 37 + evidence.hashCode()
result = result * 37 + endorsement.hashCode()
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
result += """testonlyPubkey=$testonlyPubkey"""
result += """evidence=$evidence"""
result += """endorsement=$endorsement"""
return result.joinToString(prefix = "ClientHandshakeStart{", separator = ", ", postfix = "}")
}
public fun copy(
testonlyPubkey: ByteString = this.testonlyPubkey,
evidence: ByteString = this.evidence,
endorsement: ByteString = this.endorsement,
unknownFields: ByteString = this.unknownFields,
): ClientHandshakeStart = ClientHandshakeStart(testonlyPubkey, evidence, endorsement,
unknownFields)
public class Builder : Message.Builder() {
@JvmField
public var testonlyPubkey: ByteString = ByteString.EMPTY
@JvmField
public var evidence: ByteString = ByteString.EMPTY
@JvmField
public var endorsement: ByteString = ByteString.EMPTY
/**
* Public key associated with this server's enclave. For use in test-only
* contexts where attestation is not available
*/
public fun testonlyPubkey(testonlyPubkey: ByteString): Builder {
this.testonlyPubkey = testonlyPubkey
return this
}
/**
* Remote-attestation evidence associated with the public key
*/
public fun evidence(evidence: ByteString): Builder {
this.evidence = evidence
return this
}
/**
* Endorsements of remote-attestation evidence.
*/
public fun endorsement(endorsement: ByteString): Builder {
this.endorsement = endorsement
return this
}
public override fun build(): ClientHandshakeStart = ClientHandshakeStart(
testonlyPubkey = testonlyPubkey,
evidence = evidence,
endorsement = endorsement,
unknownFields = buildUnknownFields()
)
}
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object :
ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
ClientHandshakeStart::class,
"type.googleapis.com/org.signal.cdsi.ClientHandshakeStart",
PROTO_3,
null,
"CDSI.proto"
) {
public override fun encodedSize(`value`: ClientHandshakeStart): Int {
var size = value.unknownFields.size
if (value.testonlyPubkey != ByteString.EMPTY) size +=
ProtoAdapter.BYTES.encodedSizeWithTag(1, value.testonlyPubkey)
if (value.evidence != ByteString.EMPTY) size += ProtoAdapter.BYTES.encodedSizeWithTag(2,
value.evidence)
if (value.endorsement != ByteString.EMPTY) size += ProtoAdapter.BYTES.encodedSizeWithTag(3,
value.endorsement)
return size
}
public override fun encode(writer: ProtoWriter, `value`: ClientHandshakeStart): Unit {
if (value.testonlyPubkey != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 1,
value.testonlyPubkey)
if (value.evidence != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 2,
value.evidence)
if (value.endorsement != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 3,
value.endorsement)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: ClientHandshakeStart): Unit {
writer.writeBytes(value.unknownFields)
if (value.endorsement != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 3,
value.endorsement)
if (value.evidence != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 2,
value.evidence)
if (value.testonlyPubkey != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 1,
value.testonlyPubkey)
}
public override fun decode(reader: ProtoReader): ClientHandshakeStart {
var testonlyPubkey: ByteString = ByteString.EMPTY
var evidence: ByteString = ByteString.EMPTY
var endorsement: ByteString = ByteString.EMPTY
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> testonlyPubkey = ProtoAdapter.BYTES.decode(reader)
2 -> evidence = ProtoAdapter.BYTES.decode(reader)
3 -> endorsement = ProtoAdapter.BYTES.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return ClientHandshakeStart(
testonlyPubkey = testonlyPubkey,
evidence = evidence,
endorsement = endorsement,
unknownFields = unknownFields
)
}
public override fun redact(`value`: ClientHandshakeStart): ClientHandshakeStart = value.copy(
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
}