Well, I added it correctly to the certificate store on the phone now, but still, the application would ask me to confirm whether I trusted the certificate. So, I edited by hand in Tools->Settings->General->Security->Cert. Mngment the "Trust Settings" for this certificate (Internet: yes, Online certif. check: no, VPN: yes). And now, it doesn´t prompt me anymore. So, again, many thanks.
Still,for curiosity´s sake: I have tried looking around for a way to set the certificate to trusted by software and run into the method CUnifiedCertStore::SetTrust. Unfortunately, this takes a CCTCertInfo object as an argument (instead of CCertificate) so it seems I am back to the whole rigmarole of writing to writestreams and reading from readstreams just to convert a Certificate to a CCTCertInfo. Why isn´t there a way to initialize a CCTCertInfo with a HBufC8? The only two constructors I see are either taking a RReadStream object or by means of passing a number of fields, some of which I cannot extract from CCertificate.
I tried the following (code below), but that would crash at the moment of calling "CCTCertInfo::NewL(readStream, token)".
code
HBufC8* aCertData = HBufC8::NewL(aCertificate.Encoding().Size());
aCertData->Des().Copy(aCertificate.Encoding());
MCTToken& token = iWritableStore->Token();
RBufWriteStream writeStream;
CBufFlat* bufflat = CBufFlat::NewL(2048);
writeStream.Open(*bufflat, 0);
aCertificate.ExternalizeL(writeStream);
RBufReadStream readStream(*bufflat);
CCTCertInfo* aCertInfo = CCTCertInfo::NewL(readStream, token);
TCertificateFormat certFormat = aCertInfo->CertificateFormat();
iCertStore->Retrieve(*aCertInfo, iRetrieveCertificate, iStatus);
[/code]