Hi,is there a way that i could just sign just one element from the whole
xml.i'm doing this right now, but don't know if i could selectively sign just
one of the elements instead of the whole DOMDocument. try { sig =
prov.newSignature(); sig->setDSIGNSPrefix(MAKE_UNICODE_STRING("ds"));
sig->setPrettyPrint(true); } catch (XSECException &e) {
printf("Error creating provider/DSIGNS :\n\t%s\n", e.getMsg()); return;
} printf("creating a blank doc\n"); try { sigNode =
sig->createBlankSignature((DOMDocument *)pElement, CANON_C14N_COM,
SIGNATURE_RSA, HASH_SHA1); } catch
(DOMException &e) { printf("Error Creating blank signature %s\n",
XMLString::transcode(e.getMessage())); return; } printf("done
creating a blank doc\n"); try { pElement->appendChild(sigNode); }
catch (DOMException &e) { printf("Error adding sign node to doc %s\n",
XMLString::transcode(e.getMessage())); return; }
printf("done appending sign node\n"); // Create an envelope reference for
the text to be signed ref = sig->createReference(MAKE_UNICODE_STRING(""));
ref->appendEnvelopedSignatureTransform(); printf("done adding ref\r\n");
// Load the signing key // Create the XSEC OpenSSL interface key = new
OpenSSLCryptoKeyRSA(pkey); // Create the XSEC OpenSSL interface - used only
to translate to Base64 certs = new OpenSSLCryptoX509(x); // here where
it's done, sign the doc. printf("about to sign\r\n");
sig->setSigningKey(key); sig->sign();thanks !
_________________________________________________________________
PC Magazine’s 2007 editors’ choice for best web mail—award-winning Windows Live
Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HMWL_mini_pcmag_0707