<?xml version="1.0" standalone="no"?>
<!DOCTYPE faqs SYSTEM "sbk:/style/dtd/faqs.dtd">

<faqs title="Frequently asked questions">
  <faq>
    <q>Where's the archive for this list?</q>
    <a>
      <p>Currently, <resource-ref idref="mail-arch-gmane"/> holds the messages
	of the last two weeks. This service also makes the mailinglist reachable with a news reader.</p>
      <p>You can use the ezmlm mailing list controller to recieve previous messages by email. Send an empty email to <human-resource-ref idref="mailhelp"/> for detailed information on how to use this service </p>
    </a>
  </faq>
  <faq>
    <q>Where can I learn about XML?</q>
    <a>
      <p>There are plenty of resources on the web, just use any search engine. You might start at <resource-ref idref="xmlfaq"/> or <resource-ref idref="zvon"/>.</p>
    </a>
  </faq>
  <faq>
    <q>Where can I learn about XML Digital Signatures?</q>
    <a>
      <p>The best place to start is <resource-ref idref="xmldsig"/>. Links on XML security in general can be found on <resource-ref idref="christ-page"/>.</p>
    </a>
  </faq>
  <faq>
    <q>Where can I learn about XML Encryption?</q>
    <a>
      <p>The best place to start is <resource-ref idref="xmlenc"/>. Links on XML security in general can be found on <resource-ref idref="christ-page"/></p>
    </a>
  </faq>
  <faq>
    <q>Where can I learn about Cryptography in general?</q>
    <a>
      <p>A lot of resources exist on the web, including the 'green bible' for cryptography: <resource-ref idref="hac"/>. The &hac; is completely online and it should satisfy most of your cryptographic hunger. Disadvantage of it is that it goes rather deep, so it isn't a executive overview or a &quot;Learn XYZ in 21 days&quot;-book</p>
    </a>
  </faq>
  <faq>
    <q>I have a Java-(security/cryptography) problem. Can you help me?</q>
    <a>
      <p>Go to the <resource-ref idref="javaforum"/> of Sun. You can find forums where you can ask questions like &quot;How do I generate a keypair&quot;, etc.</p>
    </a>
  </faq>
  <faq>
    <q>I have a Java-XML problem.</q>
    <a>
      <p>Go to the <resource-ref idref="javaforum"/> of Sun, section Java Technology &amp; XML and have a look at <resource-ref idref="xml4j-used"/>.</p>
    </a>
  </faq>
  <faq>
    <q>I'm using Crimson, but it throws Exceptions. Why?</q>
    <a>
      <p>Crimson is not supported at the moment. The main reason is that Crimson did not support the <code>org.w3c.dom.traversal.TreeWalker</code> interface in the past. Additionally, it does not support the <code>org.apache.xerces.dom.DocumentImpl.putIdentifier(String ID, Element e)</code> functionality where Xerces allows us to enable ID attributes during document generation.</p>
      <p>Use <resource-ref idref="xml4j-used"/> instead of Crimson.</p>
    </a>
  </faq>
  <faq>
    <q>What's up with the Bouncy Castle CSP? / Where is my CSP?</q>
    <a>
      <p>There is <em>no</em> JCE bundled together with this distribution. This is because the Apache Project web site is hosted in the US where some export restrictions apply to the cryptographic primitives. </p>
      <p>The nice guys from the <jump href="http://www.bouncycastle.org/">Legion of Bouncy Castle</jump> where so helpful to supply their JCE in a simple JAR package so that we can simply fetch it during the compilation process and put it into the <code>libs/</code> directory. When you use the ant makefile <code>build.xml</code> and simply say <code>ant compile</code> or <code>ant get-jce</code>, <code>ant</code> tries to fetch this JAR from the australian server. After that step, the compilation works completely.  </p>
      <p>The ant make tools initiates an automated download of the BouncyCastle JCE. The file is downloaded into the <code>libs/</code> directory and a &quot;bc-&quot; is prepended to the filename. This is done because we want the provider name (bc means BouncyCastle) being visible in the JAR's filename. </p>
      <p>More information can be found in the Installation section.</p>
      <note>The fact that we <em>use</em> Bouncy in this project does not mean that you <em>must</em> use it, it's only the default. If you take a look at the configuration <code>src/org/apache/xml/security/resource/config.xml</code>, you'll notice the sections which do integrate these alternative JCEs.</note> 		
    </a>
  </faq>
  <faq>
    <q>How do I enable/turn off logging?</q>
    <a>
      <p>The logging is configured in the <code>config.xml</code> file which either in the <code>xmlsec.jar</code> file or in the class path. This is a little bit complicated as config.xml is used both for library wide configurations like algorithms as well as for the user setting about log4j. This will be changed someday ;-))</p>
      <p>OK, so it goes: In the <jump href="http://cvs.apache.org/viewcvs.cgi/xml-security/src/org/apache/xml/security/resource/config.xml?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup"><code>xml-security/src/org/apache/xml/security/resource/config.xml</code></jump> file, there is an element called <code>&lt;log4j:configuration&gt;</code>. This element contains the XML style configuration information as defined in the <jump href="http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/xml/DOMConfigurator.html">log4j DOMConfigurator class</jump>. You can find examples <jump href="http://cvs.apache.org/viewcvs.cgi/jakarta-log4j/tests/input/xml/">here</jump></p>
    </a>
  </faq>
  <faq>
    <q>How do I use the package to generate and verify a signature?</q>
    <a>
      <p>Checkout the samples in <code>src_samples/org/apache/xml/security/samples/signature/</code>. </p>
      <note>The samples divide into two groups: Samples that <em>create</em> and samples that <em>verify</em> Signatures. Eventually, you should adjust the verifying program to another filename if you get <code>FileNotFoundException</code>s.</note>
    </a>
  </faq>
  <faq>
    <q>What is the meaning of <code>BaseURI</code>?</q>
    <a>
      <p>When you work with URIs like &quot;<code>http://www.example.com/index.html</code>&quot;, it is quite sure what you mean as this is an absolute URL, i.e. it is clear which protocol ise used to fetch which file from which server. When you use such a URL inside a signature, the software can automatically figure out what you sign. But when you sign something in your local file system or if you use a relative path like &quot;<code>../1.txt</code>&quot;, it's not possible to understand this reference without some context. <em>This</em> context is the <code>BaseURI</code>. For instance, if you sign <code>URI=&quot;../1.txt&quot;</code> and the <code>BaseURI=&quot;file:///home/user/work/signature.xml&quot;</code>, it is clear that the file <code>BaseURI=&quot;file:///home/user/1.txt&quot;</code> is to be signed. But when you create the signature, the file <code>BaseURI=&quot;file:///home/user/work/signature.xml&quot;</code> does not yet exist; therefore, you have to supply the URL where you intend to store the signature later (relative to the signed objects). </p>
      <p>The String BaseURI is the systemID on which the Object will be stored in the future. This is needed to resolve relative links in the <code>Reference</code> elements which point to the filesystem or something similar. </p>
      <p>Example: Imagine that you want to create a signature to store it on a web server as  <code>http://www.acme.com/signatures/sig1.xml</code>. So <code>BaseURI=&quot;http://www.acme.com/sig1.xml&quot;</code>. This means that if you create a <code>Reference</code> with <code>URI=&quot;./index.html&quot;</code>, the library can easily use it's HTTPResourceResolver to fetch <code>http://www.acme.com/index.html</code> without that you have to say <code>URI=&quot;http://www.acme.com/index.html&quot;</code>. </p>
    </a>
  </faq>
  <faq>
    <q>What is the enveloped transform?</q>
    <a>
      <p>
	The enveloped transform is a special transform that enables the use of
	so-called enveloped signatures.
      </p>
      <p>
	Enveloped signatures are signatures over an entire XML document, for
	which the <code>&lt;Signature&gt;</code> element is included in the
	document itself. An example could be:
      </p>
      <p>
	<code>
	  <![CDATA[<Root>]]><br/>
	  &nbsp;<![CDATA[<SomeContent>]]><br/>
	  &nbsp;&nbsp;<![CDATA[... ]]><br/>
	  &nbsp;<![CDATA[</SomeContent>]]><br/><em>
	  &nbsp;<![CDATA[<ds:Signature>]]><br/>
	  &nbsp;&nbsp;<![CDATA[<ds:SignedInfo>]]><br/>
	  &nbsp;&nbsp;&nbsp;<![CDATA[<ds:Reference URI="">]]><br/>
	  &nbsp;&nbsp;&nbsp;&nbsp;<![CDATA[<ds:Transforms>]]><br/>
	  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<![CDATA[<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>]]><br/>
	  &nbsp;&nbsp;&nbsp;&nbsp;<![CDATA[</ds:Transforms>]]><br/>
	  &nbsp;&nbsp;&nbsp;<![CDATA[</ds:Reference>]]><br/>
	  &nbsp;&nbsp;<![CDATA[</ds:SignedInfo>]]><br/>
	  &nbsp;&nbsp;<![CDATA[....]]><br/>
	  &nbsp;<![CDATA[</ds:Signature>]]><br/></em>
	  <![CDATA[</Root>]]><br/>
	</code>
      </p>
      <p>
	The <code>Reference</code> indicates that <code>Root</code> and it's
	descendants (except for comments) are signed, but the
	<code>Transform</code> element says to throw out the
	<code>Signature</code> element (that is the parent of this
	<code>Reference</code>) from the stream that is to be signed. Note that if there are other
	<code>Signature</code> elements in <code>Root</code>, they will remain
	untouched.
      </p>
    </a>
  </faq>
  <faq>
    <q>What's the difference between C14N and ExclC14N?</q>
    <a>
      <p>
	C14N was introduced to solve some problems that arise when signing
	XML. Because XML allows to change the representation of an XML document
	without changing the actual content, signatures may break when
	different parsers are used to generate and verify the signature. A simple
	example of such an allowed change is changing the order of attributes
	within an element. (That is solved by C14N by sorting the attributes by
	alphabet)
      </p>
      <p>
	Because a C14N'ed XML fragment inherits all the namespace declarations
	from it's ancestors, it is not possible to embed a signed XML fragment
	into a document that has other namespace declarations.
      </p>
      <p>
	This is solved by ExclC14N. ExclC14N takes extra information as input
	in which you can specify which of the ancestor's namespaces should be
	included. 
      </p>
      <p>
	For more information on this topic, have a look at the C14N and
	ExclC14N sections of <resource-ref idref="xmldsig"/>.
      </p>
    </a>
  </faq>
  <faq>
    <q>I'm using SUN JDK v1.4.0 or v1.4.1 and it get some exceptions. Any clues?</q>
    <a>
      <p>After SUN released the  <jump href="http://java.sun.com/j2se/1.4/index.html"> Java (TM) 2 Platform Standard Edition v1.4.0 </jump>, the xml-security package stopped working. This is a  <jump href="http://developer.java.sun.com/developer/bugParade/bugs/4615582.html"> known </jump> problem: SUN packaged a beta of Xalan into the JDK1.4.0, but the xml-security package requires a stable version of Xalan (v2.2.0 or later). To fix the problem, you have to put the xalan.jar into a special directory in your JDK: <code>j2sdk1.4.0/jre/lib/endorsed/xalan.jar</code>. If you installed an out-of-the-box JDK1.4 (e.g. on Windows 2000), the &quot;endorsed&quot; directory does not exist: you'll have to create it by hand.  <em>Putting this JAR to another location like lib/ext WILL NOT WORK.</em>
      </p>
      <p>For more on that, you can also check the  <jump href="http://xml.apache.org/~edwingo/jaxp-faq.html#override"> Unofficial JAXP FAQ </jump>. </p>
    </a>
  </faq>
  <faq>
    <q>I get a NullPointerException, and I don't know what's wrong.
    </q> 
    <a> 
      <p>
	Often, this problem is caused by using DOM1 calls like
	<code>createElement(), setAttribute(), createAttribute()</code>. These are
	non-namespace-aware and will cause XPath and C14N errors.<br/>
        Always use the DOM2 <code>create(Attribute|Element)NS(...)</code>
	methods instead, even if you're creating an element without a namespace
	(in that case, you can use null as a namespace).
      </p>
      <p>
	The Xalan-J Team told us that DOM1 calls are deprecated and are not to
	be used in code. xml-security has been reviewed and is DOM1 clean now. 
	The Xalan folks told us that if you create Elements or attributes 
	using DOM1 calls which are not namespace aware, they do not care about
	any problem you have because of incorrect hehaviour of Xalan.
      </p> 
    </a> 
  </faq>

  
  
  <!-- TEMPLATE -->
  <!-- 
  <faq>
  <q></q> <a> <p></p> </a> </faq>
  -->
</faqs>




