SFL: How to verify?

Erik Rissanen <[email protected]> Wed, 21 Mar 2001 16:07:16 +0100
Newsgroups gmane.ietf.sfl
Message-ID <[email protected]>
I am trying to use SFL to verify a signed SMIME message. The message has one
signerinfo with a security label and nothing  else. The signers PKC is
included in the SignerInfo.

I don't understand how to initialize the sm_free3 CTIL to use for
verification. I have successfully used SFL and sm_free3 to sign messages.
For signing I initialized a SM_Applogin with the sm_free3 DLL and a PKCS#12
file. The resulting CSM_CSInst is  associated with the private key and
signing works fine.

But having each CSM_CSInst instance to represent a private key doesn't make
sense for verify, since there is no associated private key for the
opperation. So how do I initialize a CSM_CSInst instance in this case? I
don't understand the API  documentation on this point.

The approach I have tried is to compile time link with the sm_free3 DLL and
do:

CSM_CSInst *pInst = pSMIME->m_pCSInsts->AppendL();
CSM_Free3 *pFree3 = new CSM_Free3();
pFree3->AddLogin(certBuffer, NULL, NULL, "NULL");
pInst->SetTokenInterface(pFree3);

Where certBuffer contains the certificate from the SMIME message SignerInfo.

This causes a crash in the destructor of a CSM_Buffer when
CSM_DataToVerify::Verify returns, so I guess I am doing something wrong. Is
the code above the correct approach?

Any help would be greatly appreciated.

Regards, Erik Rissanen