How to generate PublicKey for PrivateKey in X25519?
问题 I'm working with X25519-keys based encryption at the moment. My question is, basically, how to derive PublicKey from existing X25519 PrivateKey ? I have found the code in the XDHKeyPairGenerator : BigInteger publicKey = ops.computePublic(privateKey.clone()); But this package is platform-specific, thus not accessible. And I can't find a method to do it through publicly-accessible interfaces. 回答1: You must scalar multiply the private key (which is just a big number) by the 25519 curve generator