private SignedInfo createSignedInfo(List<Reference> references,SignatureAlgorithm signatureAlgorithm){
  assert references != null;
  assert signatureAlgorithm != null;
  XMLSignatureFactory factory=XMLSignatureFactory.getInstance();
  CanonicalizationMethod canonicalizationMethod;
  try {
    canonicalizationMethod=factory.newCanonicalizationMethod(SignatureConstants.TRANSFORM_C14N_EXCL_OMIT_COMMENTS,(C14NMethodParameterSpec)null);
  }
 catch (  Exception e) {
    throw new IllegalStateException("Cannot create canonicalization object.",e);
  }
  SignatureMethod signatureMethod;
  try {
    signatureMethod=factory.newSignatureMethod(signatureAlgorithm.toString(),null);
  }
 catch (  Exception e) {
    throw new IllegalStateException("Cannot create signature algorithm object.",e);
  }
  SignedInfo signedInfo=factory.newSignedInfo(canonicalizationMethod,signatureMethod,references);
  log.debug("Created SignedInfo section with signatureAlgorithm: {}",signatureAlgorithm);
  return signedInfo;
}

private SignedInfo createSignedInfo ( List < Reference > references , SignatureAlgorithm signatureAlgorithm ) { assert references != null ; assert signatureAlgorithm != null ; XMLSignatureFactory factory = XMLSignatureFactory . getInstance ( ) ; CanonicalizationMethod canonicalizationMethod ; try { canonicalizationMethod = factory . newCanonicalizationMethod ( SignatureConstants . TRANSFORM_C14N_EXCL_OMIT_COMMENTS , ( C14NMethodParameterSpec ) null ) ; } catch ( Exception e ) { throw new IllegalStateException ( "Cannot create canonicalization object." , e ) ; } SignatureMethod signatureMethod ; try { signatureMethod = factory . newSignatureMethod ( signatureAlgorithm . toString ( ) , null ) ; } catch ( Exception e ) { throw new IllegalStateException ( "Cannot create signature algorithm object." , e ) ; } SignedInfo signedInfo = factory . newSignedInfo ( canonicalizationMethod , signatureMethod , references ) ; log . debug ( "Created SignedInfo section with signatureAlgorithm: {}" , signatureAlgorithm ) ; return signedInfo ; }
creates signedinfo section part of signature .
