public static Object[] isSignatureOK(Map<String, String> docEndorserInfo,
			Node node) {

		try {
			DOMValidateContext context = createContext(node);

			XMLSignature signature = extractXmlSignature(context);

			boolean coreValidation = signature.validate(context);

			if (coreValidation) {

				KeyInfo keyInfo = signature.getKeyInfo();
				X509Certificate cert = extractX509CertFromKeyInfo(keyInfo);
				Map<String, String> certEndorserInfo = extractEndorserInfoFromCert(cert);

				String errorString = isEndorserInfoConsistent(certEndorserInfo,
						docEndorserInfo);
				if (errorString == null) {
					return new Object[] { Boolean.TRUE, cert.toString() };
				} else {
					return new Object[] { Boolean.FALSE, errorString };
				}

			} else {

				StringBuilder sb = new StringBuilder();

				boolean sv = signature.getSignatureValue().validate(context);
				sb.append("signature validation: " + sv);

				List<?> refs = signature.getSignedInfo().getReferences();
				for (Object oref : refs) {
					Reference ref = (Reference) oref;
					boolean refValid = ref.validate(context);
					sb.append("content (ref='" + ref.getURI() + "') validity: "
							+ refValid);
				}

				return new Object[] { Boolean.FALSE, sb.toString() };

			}

		} catch (MarshalException e) {
			return new Object[] { Boolean.FALSE, e.getMessage() };
		} catch (XMLSignatureException e) {
			return new Object[] { Boolean.FALSE, e.getMessage() };
		}
	}