I have a java script and want to use it in SQL oracle but don't know how and where to add the 3rd java library in the server.
I found one folder name lib
Is it the right folder or there is another folder I can Idd? which I have the .jar file need to add
I wrote a java code to sign a file from Starkbank
library and in order to be able to us the java code I have to add starkbank
library java file
import com.starkbank.ellipticcurve.PrivateKey;
import com.starkbank.ellipticcurve.PublicKey;
import com.starkbank.ellipticcurve.Signature;
import com.starkbank.ellipticcurve.Ecdsa;
import com.starkbank.ellipticcurve.Ecdsa;
import com.starkbank.ellipticcurve.PublicKey;
import com.starkbank.ellipticcurve.Signature;
import com.starkbank.ellipticcurve.utils.ByteString;
import com.starkbank.ellipticcurve.utils.File;
import java.util.*;
public class NewClass3{
public static void main(String[] args){
// Read files
// String publicKeyPem = File.read("publicKey.pem");
String PrivKeyPem = File.read("ec-secp256k1-priv-key.pem");
// PublicKey publicKey = PublicKey.fromPem(publicKeyPem);
PrivateKey privateKey = PrivateKey.fromPem(PrivKeyPem);
Base64.Encoder enc = Base64.getEncoder();
Base64.Decoder dec = Base64.getDecoder();
String str = "LcHeQ9b2bhNW291aOgeXhBHKa1uHmNoKf/ATfX+AJbo=";
// Decode data
String decoded = new String(dec.decode(str));
System.out.println("decoded value is \t" + decoded);
System.out.println("original value is \t" + str);
// Generate Signature
Signature signature = Ecdsa.sign(decoded, privateKey);
// Return the signature verification status
System.out.println("signature: " + signature);
// Encode into Base64 format - This value should add in QR code
String base64 = signature.toBase64();
// print encoded String
System.out.println("Encoded String:\n" + base64);
}
}