Sorry for my english and honestly I have a very little understanding on this so please bear with me.
I am developing a java application that sends a signed request to a Server.
To do so, I have to generate a PKCS#1 RSA key pair in PEM
format for signing and verification. I've tried using OpenSSL v.1.0.1. but the public key generated is a X.509 PEM
.
Here's the openssl command I used to generate the keys:
Private Key:
openssl genrsa -out name_of_private_key.pem 1024
Public Key
openssl rsa -in name_of_private_key.pem -pub out > name_of_public_key.pem
I've gone through this thread also and I found an open source JAVA library BouncyCastle: Generating RSA keys in PKCS#1 format in Java
But it says that BouncyCastle is only for PKCS#1 padding not encoding.
Preferably, I'm looking for ways to generate it using JAVA or any third parties if no other option is available.