This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DecryptKey { | |
//before you proceed, you need to ensure your public key is PKCS8 since that is what can be read natively in java. | |
//If your key begins with-----BEGIN CERTIFICATE-----, | |
// the it is ssleay and you need to convert it using the openssl command below | |
//openssl pkcs8 -topk8 -inform pem -in public.key -outform pem -nocrypt -out pkcs8-public-key.pem | |
//TODO You can you phpsecLib lib but it doesn't support some Library | |
//opnssl work fine | |
final private static String RSA_PRIVATE_KEY = | |
-----BEGIN PUBLIC KEY----- | |
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzTrKt2Y7HqQpt8w379Sl |