
Originally Posted by
wizard_hu_
CRSAPKCS1v15Decryptor:

ecryptL is properly declared in cryptoasymmetric.h, re-check what you are doing (for example make sure that "dec" is accessible in the given scope).
I'm sure "dec" is accessible in the given scope.
Enclosed the given function.
Code:
void CDecryptView::decryptData() {
_LIT8(aD,"12345678");
_LIT8(aN,"123456789");
//Prepare Key & Decryptor
RInteger iN = RInteger::NewL(aN);
RInteger iD = RInteger::NewL(aD);
const CRSAPrivateKeyStandard* privKey = CRSAPrivateKeyStandard::NewLC(iN, iD);
CRSAPKCS1v15Decryptor* dec = CRSAPKCS1v15Decryptor::NewL((CRSAPrivateKey&)privKey);
//Prepare filesessionserver
RFs fsSession;
fsSession.Connect();
RFile inFile, outFile;
//Open, Read, Flush and Close inputFile
inFile.Open(fsSession,_L("C:\\shared\\test_0_cipher.txt"),EFileRead);
TBuf8<1024> cipherText;
TInt size;
inFile.Size(size);
inFile.Read(cipherText,size);
inFile.Flush();
inFile.Close();
//Decrypt
TBuf8<1024> plainText;
TInt maxInputLength;
TInt maxOutputLength;
maxInputLength = dec->MaxInputLength(); // no error
maxOutputLength = dec->MaxOutputLength(); // no error
dec->DecryptL(cipherText,plainText); // ERROR
//Open, Write, Flush and Close outputFile
TInt err = outFile.Open(fsSession,_L("c:\\shared\\test_0_cipher_out.txt"),EFileWrite);
if (err==KErrNotFound) //
outFile.Create(fsSession,_L("c:\\shared\\test_0_cipher_out.txt"),EFileStreamText|EFileWrite|EFileShareAny);
outFile.Write(plainText,size);
outFile.Flush();
outFile.Close();
RFileLogger::WriteFormat(fileDir, fileName, EFileLoggingModeAppend,
Exception, 10000);
}
Any other idea?
Thanks,
Andree