equal
deleted
inserted
replaced
|
1 /* |
|
2 * otr4j, the open source java otr library. |
|
3 * |
|
4 * Distributable under LGPL license. |
|
5 * See terms of license at gnu.org. |
|
6 */ |
|
7 package net.java.otr4j.io.messages; |
|
8 |
|
9 import java.util.Arrays; |
|
10 |
|
11 /** |
|
12 * |
|
13 * @author George Politis |
|
14 */ |
|
15 public class RevealSignatureMessage extends SignatureMessage { |
|
16 // Fields. |
|
17 public byte[] revealedKey; |
|
18 |
|
19 // Ctor. |
|
20 public RevealSignatureMessage(int protocolVersion, byte[] xEncrypted, |
|
21 byte[] xEncryptedMAC, byte[] revealedKey) { |
|
22 super(MESSAGE_REVEALSIG, protocolVersion, xEncrypted, xEncryptedMAC); |
|
23 |
|
24 this.revealedKey = revealedKey; |
|
25 } |
|
26 |
|
27 // Methods. |
|
28 @Override |
|
29 public int hashCode() { |
|
30 final int prime = 31; |
|
31 int result = super.hashCode(); |
|
32 result = prime * result + Arrays.hashCode(revealedKey); |
|
33 return result; |
|
34 } |
|
35 |
|
36 @Override |
|
37 public boolean equals(Object obj) { |
|
38 if (this == obj) |
|
39 return true; |
|
40 if (!super.equals(obj)) |
|
41 return false; |
|
42 if (getClass() != obj.getClass()) |
|
43 return false; |
|
44 RevealSignatureMessage other = (RevealSignatureMessage) obj; |
|
45 if (!Arrays.equals(revealedKey, other.revealedKey)) |
|
46 return false; |
|
47 return true; |
|
48 } |
|
49 } |