Renamed 'device key' to 'signed prekey'.

This commit is contained in:
Moxie Marlinspike
2014-07-11 10:37:19 -07:00
parent 06f80c320d
commit b724ea8d3b
7 changed files with 65 additions and 64 deletions

View File

@@ -28,23 +28,23 @@ public class PreKeyResponseItemV2 {
private int registrationId;
@JsonProperty
private DeviceKey deviceKey;
private SignedPreKey signedPreKey;
@JsonProperty
private PreKeyV2 preKey;
public PreKeyResponseItemV2() {}
public PreKeyResponseItemV2(long deviceId, int registrationId, DeviceKey deviceKey, PreKeyV2 preKey) {
public PreKeyResponseItemV2(long deviceId, int registrationId, SignedPreKey signedPreKey, PreKeyV2 preKey) {
this.deviceId = deviceId;
this.registrationId = registrationId;
this.deviceKey = deviceKey;
this.signedPreKey = signedPreKey;
this.preKey = preKey;
}
@VisibleForTesting
public DeviceKey getDeviceKey() {
return deviceKey;
public SignedPreKey getSignedPreKey() {
return signedPreKey;
}
@VisibleForTesting

View File

@@ -35,7 +35,7 @@ public class PreKeyStateV2 {
@JsonProperty
@NotNull
@Valid
private DeviceKey deviceKey;
private SignedPreKey signedPreKey;
@JsonProperty
@NotNull
@@ -49,9 +49,11 @@ public class PreKeyStateV2 {
public PreKeyStateV2() {}
@VisibleForTesting
public PreKeyStateV2(String identityKey, DeviceKey deviceKey, List<PreKeyV2> keys, PreKeyV2 lastResortKey) {
public PreKeyStateV2(String identityKey, SignedPreKey signedPreKey,
List<PreKeyV2> keys, PreKeyV2 lastResortKey)
{
this.identityKey = identityKey;
this.deviceKey = deviceKey;
this.signedPreKey = signedPreKey;
this.preKeys = keys;
this.lastResortKey = lastResortKey;
}
@@ -60,8 +62,8 @@ public class PreKeyStateV2 {
return preKeys;
}
public DeviceKey getDeviceKey() {
return deviceKey;
public SignedPreKey getSignedPreKey() {
return signedPreKey;
}
public String getIdentityKey() {

View File

@@ -5,15 +5,15 @@ import org.hibernate.validator.constraints.NotEmpty;
import java.io.Serializable;
public class DeviceKey extends PreKeyV2 implements Serializable {
public class SignedPreKey extends PreKeyV2 implements Serializable {
@JsonProperty
@NotEmpty
private String signature;
public DeviceKey() {}
public SignedPreKey() {}
public DeviceKey(long keyId, String publicKey, String signature) {
public SignedPreKey(long keyId, String publicKey, String signature) {
super(keyId, publicKey);
this.signature = signature;
}
@@ -24,8 +24,8 @@ public class DeviceKey extends PreKeyV2 implements Serializable {
@Override
public boolean equals(Object object) {
if (object == null || !(object instanceof DeviceKey)) return false;
DeviceKey that = (DeviceKey) object;
if (object == null || !(object instanceof SignedPreKey)) return false;
SignedPreKey that = (SignedPreKey) object;
if (signature == null) {
return super.equals(object) && that.signature == null;