I'm developing some cryptography on BlackBerry, and we're working with certificates. We use BouncyCastle Lightweight API instead of RIM api to apply the cryptography, but in the lightweight API PEMWriter doesn't work (Well, it isn't included because it needs some JCE).
public RSAPrivateCrtKeyParameters _RSAPrivateKey;
public RSAKeyParameters _RSAPublicKey;
I get this keys from the object
AsymmetricCipherKeyPair theKeyPair
So, i need a method to BASE64Encode the two keys, or how to transform this keys to other objects that can be directly transformed to base64/PEM format. I can generate the certificate manually, but i need the encoding of the keys.
I know there are methods to do this, but all require PEMWriter or APIs that are not enabled with j2ME and the bouncycastle lightweight API.
You could look into the PEMWriter/PEMReader code of bouncy castle and use their implementation as a reference:
PemWriter
PemReader
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With