The way i understand it, a key encoding should return a sequence of bytes in some specific encoding such as UTF-8 for example.
However, logging the following:
KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC");
kpg.initialize(256);
KeyPair kp = kpg.generateKeyPair();
Log("TEST : ${kp.public.encoded}")
Log("Test : ${kp.public.encoded}")
Equivalently, in Java:
kp.getPublic().getEncoded();
Is giving me 2 different byte arrays! What am i missing here?
It seems that every time i call the encoded method, different pairs are generated.