Reading PKCS#1 private key from file
843811Feb 4 2008 — edited Feb 7 2008Hi I'm pretty new to JCE/JSSE. I'd like to read in a PKCS#1 formatted private key from a file. The goal of this is to extract the modulus to validate against a public key (verify they are a key pair).
To accomplish this I can read in the privatekey into a byte array and I tried to create a "RSAPrivateCrtKeySpec" object but the constructor requires many of values I don't directly have (unless i can somehow extract them from the file/byteArray)
Is there a way to do this without relying on external calls to openssl to extract portions of the key from the file?
Thanks for your help,
Chris