0

I need to sign my documents using ALGO_ID_C14N11_OMIT_COMMENTS and ALGO_ID_C14N11_WITH_COMMENTS canonicalization. Can you tell me what should I change to xades4j to permit this (Isimply need xades_bes and xades_t, no verification by now).

Should I create a wrapper class in xades4j.algorithms like the already present? and then?

Lance Roberts
  • 22,383
  • 32
  • 112
  • 130
Michele Bortolato
  • 707
  • 2
  • 11
  • 27

1 Answers1

3

You can create the derived class or use the GenericAlgorithm class and pass the algorithm uri.

Then you need to configure the algorithms provider on the signing profile that you're using to create signers. You can define a new provider or maybe extend the default and override the needed methods. To register the provider on the signing profile you use the withAlgorithmsProviderEx method.

lgoncalves
  • 2,040
  • 1
  • 14
  • 12
  • Thanks. I created, for example the class for c1411 omitcomment this way: `public class CanonicalXMLWithoutComments11 extends Algorithm{ public CanonicalXMLWithoutComments11(){ super(Canonicalizer.ALGO_ID_C14N11_OMIT_COMMENTS); } }` Do i need also to add the binding to `AlgorithmParametersBindingsModule` class? – Michele Bortolato Sep 04 '12 at 20:18
  • I didn't add the option to register new parameter marshallers on the profiles because I wanted to give a try to the marshallers approach first :) So, yes, you'll need to register it on the module or use the `GenericAlgorithm` class. – lgoncalves Sep 05 '12 at 09:19