I want to generate unique API Key and Secret Key and map each of this pair to unique projects in database. So I need a function to generate unique pair of keys.
How to generate unique api key and secret key in Java / database ?
I want to generate unique API Key and Secret Key and map each of this pair to unique projects in database. So I need a function to generate unique pair of keys.
How to generate unique api key and secret key in Java / database ?
I didnt study functionalities of Charboost, it's not the initial question.
I only get that you would get some secret/public Key (this site use signature for example), then an asymetric pair of key. After, you do what your want.
For this rather general purpose, I propose to use RSA, well implemented in Java (other algorithms exist).
see this post: Generate RSA key pair and encode private as string
public key =>
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
keyGen.initialize(512);
byte[] publicKey = keyGen.genKeyPair().getPublic().getEncoded();
private key =>
byte[] privateKey = keyGen.generateKeyPair().getPrivate().getEncoded();