Milan,
You *should* be able to follow basically the same process multiple times and add a new EncryptedKey for each public key.
The XENCEncryptedKey class has a method ::setRecipient(XMLCh*) which will set a "recipient" attribute for the EncryptedKey element. That can be used as a hint to the application as to who the particular EncryptedKey is aimed at.
Is that what you're after?
Cheers,
BerinMilan Tomic wrote:
Berin,
Is XML encryption using multiple public keys supported by XSEC library? Here is how I encrypt using one key:
XSECCryptoKey * kek = NULL; HCRYPTKEY hkey; CryptImportPublicKeyInfo(win32RSACSP, MY_ENCODING_TYPE, &(pCert->pCertInfo->SubjectPublicKeyInfo), &hkey);
kek = new WinCAPICryptoKeyRSA(win32RSACSP, hkey); kekAlg = ENCRYPT_RSA_15; cipher->setKEK(kek);
XENCEncryptedKey *xkey = cipher->encryptKey(keyStr, keyLen, kekAlg); xenc = cipher->getEncryptedData(); xenc->appendEncryptedKey(xkey);
How can I set more than one key?
Best regards, Milan
