[xmlsec] Help with x509 Serial

Chris McQueen chris at dctransform.com
Tue Oct 3 22:42:47 PDT 2006


That did it!  Thanks so much for pointing a newbie to the right places, 
Aleksey :)

For those it may help:

in sign3 example, I add
    xmlNodePtr X509DataNode = NULL;

after
    xmlNodePtr keyInfoNode = NULL;

then replace:
    if(xmlSecTmplKeyInfoAddX509Data(keyInfoNode) == NULL) {
    fprintf(stderr, "Error: failed to add X509Data node\n");
    goto done;       
    }

with:
    /* add cert and serial <dsig:X509Data/> */
    X509DataNode = xmlSecTmplKeyInfoAddX509Data(keyInfoNode);
    xmlSecTmplX509DataAddIssuerSerial(X509DataNode);
    xmlSecTmplX509DataAddSubjectName(X509DataNode);
    xmlSecTmplX509DataAddCertificate(X509DataNode);

And it outputs the X509 issuer name and serial.along with the cert block



Aleksey Sanin wrote:
> You need to put the x509 nodes inside x509data node.
>
> >    xmlSecTmplX509DataAddIssuerSerial(X509DataNode);
> >    xmlSecTmplX509DataAddSubjectName(X509DataNode);
> >    xmlSecTmplX509DataAddSKI(X509DataNode);
> >    xmlSecTmplX509DataAddCertificate(X509DataNode);
> >    xmlSecTmplX509DataAddCRL(X509DataNode);
>
> Aleksey
>
>



More information about the xmlsec mailing list