Rename key parser classes.

parent de8a60ea
Pipeline #3305 passed with stage
in 6 minutes and 54 seconds
......@@ -9,8 +9,11 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import java.security.GeneralSecurityException;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
class Curve25519KeyParser implements KeyParser {
class AgreementKeyParser implements KeyParser {
@Override
public PublicKey parsePublicKey(byte[] encodedKey)
......
......@@ -86,8 +86,8 @@ class CryptoComponentImpl implements CryptoComponent {
signatureKeyPairGenerator = new KeyPairGenerator();
signatureKeyPairGenerator.initialize(SIGNATURE_KEY_PAIR_BITS,
secureRandom);
agreementKeyParser = new Curve25519KeyParser();
signatureKeyParser = new EdKeyParser();
agreementKeyParser = new AgreementKeyParser();
signatureKeyParser = new SignatureKeyParser();
messageEncrypter = new MessageEncrypter(secureRandom);
}
......
......@@ -9,8 +9,11 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import java.security.GeneralSecurityException;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
class EdKeyParser implements KeyParser {
class SignatureKeyParser implements KeyParser {
@Override
public PublicKey parsePublicKey(byte[] encodedKey)
......
......@@ -68,9 +68,9 @@ public class KeyAgreementTest extends BrambleTestCase {
public void testRfc7748TestVector() {
// Private keys need to be clamped because curve25519-java does the
// clamping at key generation time, not multiplication time
byte[] aPriv = Curve25519KeyParser.clamp(fromHexString(ALICE_PRIVATE));
byte[] aPriv = AgreementKeyParser.clamp(fromHexString(ALICE_PRIVATE));
byte[] aPub = fromHexString(ALICE_PUBLIC);
byte[] bPriv = Curve25519KeyParser.clamp(fromHexString(BOB_PRIVATE));
byte[] bPriv = AgreementKeyParser.clamp(fromHexString(BOB_PRIVATE));
byte[] bPub = fromHexString(BOB_PUBLIC);
byte[] sharedSecret = fromHexString(SHARED_SECRET);
Curve25519 curve25519 = Curve25519.getInstance("java");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment