[xmlsec] How to get Certificate from signed xml file
Hi, How I can get the certificate from a signed xml file and save this vertificate as a file on my local machine? Thanks for any help ___ xmlsec mailing list xmlsec@aleksey.com http://www.aleksey.com/mailman/listinfo/xmlsec
Re: [xmlsec] How to get Certificate from signed xml file
If you are writing a program in C then you have access to the signature certificates through xmlSecDsigCtx data structure. Check the documentation for more details. Aleksey ___ xmlsec mailing list xmlsec@aleksey.com http://www.aleksey.com/mailman/listinfo/xmlsec
Re: [xmlsec] How to get Certificate from signed xml file
You can get to signature key, from key you can get access to "KeyData" objects. Then you need to iterate through the list and find one for certificate (note, this part is crypto specific!). Then you can get a handle no native "crypto" certificate (e.g. for OpenSSL it will be X509*). Aleksey Jürgen Heiss wrote: Hi Aleksey, Well I have access to the xmlsecDsigCtx, but I didn't find any possiblity to get access to the certificate itself or to save the certificate ;o( -Original Message- From: Aleksey Sanin [mailto:[EMAIL PROTECTED] Sent: Dienstag, 02. Mai 2006 16:45 To: Jürgen Heiss Cc: Alexandre Kalendarev; xmlsec@aleksey.com Subject: Re: [xmlsec] How to get Certificate from signed xml file If you are writing a program in C then you have access to the signature certificates through xmlSecDsigCtx data structure. Check the documentation for more details. Aleksey ___ xmlsec mailing list xmlsec@aleksey.com http://www.aleksey.com/mailman/listinfo/xmlsec
Re: [xmlsec] How to get Certificate from signed xml file
Well i find my certificate, but how to export now? I believe you found the key, not certificate. Look at KeyData objects in this key. Aleksey ___ xmlsec mailing list xmlsec@aleksey.com http://www.aleksey.com/mailman/listinfo/xmlsec
RE: [xmlsec] How to get Certificate from signed xml file
Hi Aleksey, Well now I got my Certificate from signed xml ;o) Using the following code. key = dsigCtx.signKey; size = xmlSecPtrListGetSize(key->dataList); sdata = (*((dsigCtx).signKey)).dataList; for(pos = 0; pos < size; ++pos) { tmp = (xmlSecKeyDataPtr)xmlSecPtrListGetItem(key->dataList, pos); if((tmp != NULL) && (tmp->id == sdata->id)) return(xmlSecPtrListSet(key->dataList, data, pos)); } But I still don't find a way the export this certificate to my local machine for example c:\mycert.cer. Thanks for any help -Original Message- From: Aleksey Sanin [mailto:[EMAIL PROTECTED] Sent: Dienstag, 02. Mai 2006 17:45 To: Jürgen Heiss Cc: xmlsec@aleksey.com Subject: Re: [xmlsec] How to get Certificate from signed xml file > Well i find my certificate, but how to export now? I believe you found the key, not certificate. Look at KeyData objects in this key. Aleksey ___ xmlsec mailing list xmlsec@aleksey.com http://www.aleksey.com/mailman/listinfo/xmlsec
Re: [xmlsec] How to get Certificate from signed xml file
But I still don't find a way the export this certificate to my local machine for example c:\mycert.cer. http://www.aleksey.com/xmlsec/api/xmlsec-openssl-x509.html#XMLSECOPENSSLKEYDATAX509GETCERT Aleksey ___ xmlsec mailing list xmlsec@aleksey.com http://www.aleksey.com/mailman/listinfo/xmlsec
RE: [xmlsec] How to get Certificate from signed xml file
Thank Aleksey. This is my code. key = dsigCtx.signKey; size = xmlSecPtrListGetSize(key->dataList); sdata = (*((dsigCtx).signKey)).dataList; for(pos = 0; pos < size; ++pos) { tmp = (xmlSecKeyDataPtr)xmlSecPtrListGetItem(key->dataList, pos); if(tmp != NULL) xmlSecPtrListSet(key->dataList, data, pos); } x509 = xmlSecOpenSSLKeyDataX509GetCert(tmp, pos); But x509 is alwys 0x00. Any ideas why this can be? Thanks Jürgen -Original Message- From: Aleksey Sanin [mailto:[EMAIL PROTECTED] Sent: Mittwoch, 03. Mai 2006 08:51 To: Jürgen Heiss Cc: xmlsec@aleksey.com Subject: Re: [xmlsec] How to get Certificate from signed xml file > > But I still don't find a way the export this certificate to my local machine > for example c:\mycert.cer. http://www.aleksey.com/xmlsec/api/xmlsec-openssl-x509.html#XMLSECOPENSSLKEYDATAX509GETCERT Aleksey ___ xmlsec mailing list xmlsec@aleksey.com http://www.aleksey.com/mailman/listinfo/xmlsec
Re: [xmlsec] How to get Certificate from signed xml file
So, Now I got my certificate. I was using the xmlSecMSCryptoKeyDataX509GetCert Function. The X509 Struct is filled, but how can I write this info now to my local disk into one cert file? http://www.openssl.org/docs/ Aleksey ___ xmlsec mailing list xmlsec@aleksey.com http://www.aleksey.com/mailman/listinfo/xmlsec