Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
01-26-2012 11:53 AM
I need help, I'm implementing RSACryptoToken, and I've faced the issue, connected with
decryptRSA and signRSA. According to the documentation, they need to perform raw RSA decrypting and signing.
Does BB provides such API, and how to implement this? Maybe there are any examples.
Thanks in advance
01-26-2012 01:14 PM
//here is how you would use RSA to sign data:
byte dataBytes = [bytes of data to sign];
PKCS1SignatureSigner signer = (PKCS1SignatureSigner) SignatureSignerFactory.getInstance([RSA Private Key], "RSA_PKCS1_V15/SHA1");
signer.update(dataBytes, 0, dataBytes.length);
byte signatureBytes = new byte[signer.getLength()];
//...and to decrypt using RSA...
ByteArrayInputStream inputStream = new ByteArrayInputStream([encrypted bytes]);
BlockDecryptor decryptor = new BlockDecryptor(new PKCS1UnformatterEngine(new RSADecryptorEngine([RSA Private Key])), inputStream);
byte decrypted = IOUtilities.streamToBytes(decryptor);
Take a look at the net.rim.device.api.crypto libraries
01-27-2012 03:50 AM
Thanks for reply!
But it still doesn't help me.
I sign S/MIME message with RSACryptoToken method signRSA, and after signing I get a message from S/MIME:
"Verification failed: invalid signature"