[headless] address review comments for remote contact adding

This commit is contained in:
Torsten Grote
2019-05-15 12:36:33 -03:00
parent faa6a85148
commit 435b43488a
8 changed files with 102 additions and 20 deletions

View File

@@ -49,9 +49,8 @@ public class BriarTestUtils {
public static String getRealHandshakeLink(CryptoComponent cryptoComponent) {
KeyPair keyPair = cryptoComponent.generateAgreementKeyPair();
byte[] linkBytes = new byte[RAW_LINK_BYTES];
byte[] version = new byte[] {FORMAT_VERSION};
byte[] publicKey = keyPair.getPublic().getEncoded();
arraycopy(version,0, linkBytes, 0, 1);
linkBytes[0] = FORMAT_VERSION;
arraycopy(publicKey,0, linkBytes, 1, RAW_LINK_BYTES - 1);
return ("briar://" + Base32.encode(linkBytes)).toLowerCase();
}