On 3/7/16 5:54 AM,
jordiw...@gmail.com wrote:
> *Hi everyone*,
>
> Firstly *thank you* for your job.
>
>
> My problem is that I'm trying to*sign invoices*, and the structure of
> signned info *should be like this*:
>
> <*ds:SignedInfo *Id="Signature-SignedInfo">
> <*ds:CanonicalizationMethod*
> Algorithm="
http://www.w3.org/2001/10/xml-exc-c14n#"/>
> <*ds:SignatureMethod
> Algorithm*="
http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
> <*ds:Reference* Id="SignedProperties"
> <*ds:DigestMethod* Algorithm="
http://www.w3.org/2000/09/xmldsig#sha1"/>
> <*ds:DigestValue*>A ... 4=<*/ds:DigestValue*>
> <*/ds:Reference*>
> <*ds:Reference* URI="#Certificate">
> <*ds:DigestMethod *Algorithm="
http://www.w3.org/2000/09/xmldsig#sha1"/>
> <*ds:DigestValue*>q ... E=<*/ds:DigestValue*>
> <*/ds:Reference*>
> <*ds:Reference* URI="">
> <*ds:Transforms*>
> <*ds:Transform*
> Algorithm="
http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
> <*/ds:Transforms*>
> <*ds:DigestMethod* Algorithm="
http://www.w3.org/2000/09/xmldsig#sha1"/>
> <*ds:DigestValue*>5 ...cY=<*/ds:DigestValue*>
> <*/ds:Reference*>
> <*/ds:SignedInfo*>
>
> I *need reference the certificate and the signed properties* plus
> invoice content, I can use *etsi or xades* it doesn't matter.
>
> This is my *certificate*:
> <*ds:KeyInfo* Id="Certificate">
> <*ds:X509Data*>
> <*ds:X509Certificate*>MIIFPj ... o= <*/ds:X509Certificate*>
> <*/ds:X509Data*>
> <*ds:KeyValue*>
> <*ds:RSAKeyValue*>
> <*ds:Modulus*>nX .. .Q==<*/ds:Modulus*>
> <*ds:Exponent*>A..B<*/ds:Exponent*>
> <*/ds:RSAKeyValue*>
> <*/ds:KeyValue*>
> <*/ds:KeyInfo*>
>
> And this my*signed properties*:
> <*ds:Object* Id="Signature-Object">
> <*xades:QualifyingProperties
> *xmlns:xades="
http://uri.etsi.org/01903/v1.3.2#" Target="#Signature">
> <*xades:SignedPropertie*s Id="Signature-SignedProperties">
> <*xades:SignedSignatureProperties*>
> <*xades:SigningTime*>2016-03-07T09:04:15+01:00<*/xades:SigningTime*>
> <*xades:SigningCertificate*>
> <*xades:Cert*>
> <*xades:CertDigest*>
> <*ds:DigestMethod* Algorithm="
http://www.w3.org/2000/09/xmldsig#sha1"/>
> <*ds:DigestValue*>un ... 4=<*/ds:DigestValue*>
> <*/xades:CertDigest*>
> <*xades:IssuerSerial*>
> <*ds:X509IssuerName*>OU=FNMT Clase 2 CA,O=FNMT,C=ES<*/ds:X509IssuerName*>
> <*ds:X509SerialNumber*>1...3<*/ds:X509SerialNumber*>
> <*/xades:IssuerSerial*>
> <*/xades:Cert*>
> <*/xades:SigningCertificate*>
> <*xades:SignaturePolicyIdentifier*>
> <*xades:SignaturePolicyId*>
> <*xades:SigPolicyId*>
> <*xades:Identifier*>
http://www.facturae.es/politica_de_firma_formato_facturae/politica_de_firma_formato_facturae_v3_1.pdf<*/xades:Identifier*>
> <*xades:Description*>Política de Firma FacturaE v3.1<*/xades:Description*>
> <*/xades:SigPolicyId*>
> <*xades:SigPolicyHash*>
> <*ds:DigestMethod* Algorithm="
http://www.w3.org/2000/09/xmldsig#sha1"/>
> <*ds:DigestValue*>Ohi ... M=<*/ds:DigestValue*>
> <*/xades:SigPolicyHash*>
> <*/xades:SignaturePolicyId*>
> <*/xades:SignaturePolicyIdentifier*>
> <*xades:SignerRole*>
> <*xades:ClaimedRoles*>
> <*xades:ClaimedRole*>Third party<*/xades:ClaimedRole*>
> <*/xades:ClaimedRoles*>
> <*/xades:SignerRole*>
> <*/xades:SignedSignatureProperties*>
> <*xades:SignedDataObjectProperties*>
> <*xades:DataObjectFormat* ObjectReference="#Reference">
> <*xades:Description*>Factura electrónica<*/xades:Description*>
> <*xades:MimeType*>text/xml<*/xades:MimeType*>
> <*/xades:DataObjectFormat*>
> <*/xades:SignedDataObjectProperties*>
> <*/xades:SignedProperties*>
> <*/xades:QualifyingProperties*>
> <*/ds:Object*>
> <*/ds:Signature*>
>
> I had been trying reference with *addreference* method the object
> signedProperties added with *addObject* and the cert added with
> *addStatiCert*, and this is my results:
>
> -If I don't reference the certificate and the signed properties this
> is te result. -> (*Warning*: It has not been validated politics. Error
> signature) (/warning.png/)
>
> -But when i put the reference, this is the result -> ("The data has
> been altered or there is an error in the firm") (/error.png/)
>
>
> Can you help me?
> Thank you again.
>
> Excuse me for my english it isn't my native language.
>
How are you creating the XAdES object? The library currently doesn't
support XAdES so it would have needed to be created externally and then
used with the rest of the library to create the signature document -
even then I am not sure wether or not it would conform as I havent
looked at what all needs to be done when working with the advanced
signatures.
Rob