Author: buildbot Date: Tue Mar 4 16:19:23 2014 New Revision: 900001 Log: Production update by buildbot for camel
Modified: websites/production/camel/content/book-dataformat-appendix.html websites/production/camel/content/book-in-one-page.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/xmlrpc.html websites/production/camel/content/xstream.html Modified: websites/production/camel/content/book-dataformat-appendix.html ============================================================================== --- websites/production/camel/content/book-dataformat-appendix.html (original) +++ websites/production/camel/content/book-dataformat-appendix.html Tue Mar 4 16:19:23 2014 @@ -530,39 +530,26 @@ from("activemq:My.Queue"). </dependency> ]]></script> </div></div> -<h2 id="BookDataFormatAppendix-XStream">XStream</h2> - -<p>XStream is a <a shape="rect" href="data-format.html">Data Format</a> which uses the <a shape="rect" class="external-link" href="http://xstream.codehaus.org/" rel="nofollow">XStream library</a> to marshal and unmarshal Java objects to and from XML.</p> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ -// lets turn Object messages into XML then send to MQSeries +<h2 id="BookDataFormatAppendix-XStream">XStream</h2><p>XStream is a <a shape="rect" href="data-format.html">Data Format</a> which uses the <a shape="rect" class="external-link" href="http://xstream.codehaus.org/" rel="nofollow">XStream library</a> to marshal and unmarshal Java objects to and from XML.</p><p>To use XStream in your camel routes you need to add the a dependency on <strong>camel-xstream</strong> which implements this data format.</p><p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-xstream</artifactId> + <version>x.x.x</version> + <!-- use the same version as your Camel core version --> +</dependency> +]]></script> +</div></div><h3 id="BookDataFormatAppendix-UsingtheJavaDSL.1">Using the Java DSL</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[// lets turn Object messages into XML then send to MQSeries from("activemq:My.Queue"). marshal().xstream(). to("mqseries:Another.Queue"); ]]></script> -</div></div> - -<h3 id="BookDataFormatAppendix-XMLInputFactoryandXMLOutputFactory">XMLInputFactory and XMLOutputFactory </h3> -<p><a shape="rect" class="external-link" href="http://xstream.codehaus.org/" rel="nofollow">The XStream library</a> uses the <code>javax.xml.stream.XMLInputFactory</code> and <code>javax.xml.stream.XMLOutputFactory</code>, you can control which implementation of this factory should be used.</p> - -<p>The Factory is discovered using this algorithm:<br clear="none"> -1. Use the <code>javax.xml.stream.XMLInputFactory</code> , <code>javax.xml.stream.XMLOutputFactory</code> system property.<br clear="none"> -2. Use the <code>lib/xml.stream.properties</code> file in the <code>JRE_HOME</code> directory.<br clear="none"> -3. Use the Services API, if available, to determine the classname by looking in the <code>META-INF/services/javax.xml.stream.XMLInputFactory</code>, <code>META-INF/services/javax.xml.stream.XMLOutputFactory</code> files in jars available to the JRE.<br clear="none"> -4. Use the platform default XMLInputFactory,XMLOutputFactory instance.</p> - -<h3 id="BookDataFormatAppendix-HowtosettheXMLencodinginXstreamDataFormat?">How to set the XML encoding in Xstream DataFormat?</h3> -<p>From Camel 2.2.0, you can set the encoding of XML in Xstream DataFormat by setting the Exchange's property with the key <code>Exchange.CHARSET_NAME</code>, or setting the encoding property on Xstream from DSL or Spring config.</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ -from("activemq:My.Queue"). +</div></div><h3 id="BookDataFormatAppendix-XMLInputFactoryandXMLOutputFactory">XMLInputFactory and XMLOutputFactory</h3><p><a shape="rect" class="external-link" href="http://xstream.codehaus.org/" rel="nofollow">The XStream library</a> uses the <code>javax.xml.stream.XMLInputFactory</code> and <code>javax.xml.stream.XMLOutputFactory</code>, you can control which implementation of this factory should be used.</p><p>The Factory is discovered using this algorithm:<br clear="none"> 1. Use the <code>javax.xml.stream.XMLInputFactory</code> , <code>javax.xml.stream.XMLOutputFactory</code> system property.<br clear="none"> 2. Use the <code>lib/xml.stream.properties</code> file in the <code>JRE_HOME</code> directory.<br clear="none"> 3. Use the Services API, if available, to determine the classname by looking in the <code>META-INF/services/javax.xml.stream.XMLInputFactory</code>, <code>META-INF/services/javax.xml.stream.XMLOutputFactory</code> files in jars available to the JRE.<br clear="no ne"> 4. Use the platform default XMLInputFactory,XMLOutputFactory instance.</p><h3 id="BookDataFormatAppendix-HowtosettheXMLencodinginXstreamDataFormat?">How to set the XML encoding in Xstream DataFormat?</h3><p>From Camel 2.2.0, you can set the encoding of XML in Xstream DataFormat by setting the Exchange's property with the key <code>Exchange.CHARSET_NAME</code>, or setting the encoding property on Xstream from DSL or Spring config.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[from("activemq:My.Queue"). marshal().xstream("UTF-8"). to("mqseries:Another.Queue"); ]]></script> -</div></div> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> @@ -587,22 +574,6 @@ from("activemq:My.Queue"). </camelContext> ]]></script> </div></div> - -<h3 id="BookDataFormatAppendix-Dependencies.3">Dependencies</h3> - -<p>To use XStream in your camel routes you need to add the a dependency on <strong>camel-xstream</strong> which implements this data format. </p> - -<p>If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ -<dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-xstream</artifactId> - <version>x.x.x</version> -</dependency> -]]></script> -</div></div> <h2 id="BookDataFormatAppendix-CSV">CSV</h2><p>The CSV <a shape="rect" href="data-format.html">Data Format</a> uses <a shape="rect" class="external-link" href="http://commons.apache.org/proper/commons-csv/">Apache Commons CSV</a> to handle CSV payloads (Comma Separated Values) such as those exported/imported by Excel.</p><h3 id="BookDataFormatAppendix-Options">Options</h3><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>config</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>CSVConfig</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Can be used to set a custom <code>CSVConfig</code> object.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>strategy</p></td><td colsp an="1" rowspan="1" class="confluenceTd"><p>CSVStrategy</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Can be used to set a custom <code>CSVStrategy</code>; the default is <code>CSVStrategy.DEFAULT_STRATEGY</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>autogenColumns</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Whether or not columns are auto-generated in the resulting CSV. The default value is <code>true</code>; subsequent messages use the previously created columns with new fields being added at the end of the line.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>delimiter</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>String</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.4:</strong> The column delimiter to use; the default value is "<code>,</code>".</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>skipFirstLine</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> Whether or not to skip the first line of CSV input when unmarshalling (e.g. if the content has headers on the first line); the default value is <code>false</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">lazyLoad</td><td colspan="1" rowspan="1" class="confluenceTd">boolean</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.12.2:</strong><span><span> Whether or not to </span></span><span style="line-height: 1.4285715;">Sequential access CSV input through an iterator which could avoid OOM exception when processing huge CSV file; </span><span>the default value is false </span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">useMaps</td><td colspan="1" rowspan="1" class="confluenceTd">boolean</td><td colspan="1" rowspan="1" class="co nfluenceTd"><strong>Camel 2.13:</strong> Whether to use List<Map> when unmarshalling instead of List<List>.</td></tr></tbody></table></div><h3 id="BookDataFormatAppendix-MarshallingaMaptoCSV">Marshalling a Map to CSV</h3><p>The component allows you to marshal a Java Map (or any other message type that can be <a shape="rect" href="type-converter.html">converted</a> in a Map) into a CSV payload.</p><p>An example: if you send a message with this map...</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ Map<String, Object> body = new HashMap<String, Object>(); @@ -776,7 +747,7 @@ csvConfig.setDelimiter(';'); </div></div><p>doesn't work. You have to set the delimiter as a String!</p> </div> </div> -<h3 id="BookDataFormatAppendix-Dependencies.4">Dependencies</h3><p>To use CSV in your Camel routes you need to add a dependency on <strong>camel-csv</strong>, which implements this data format.</p><p>If you use Maven you can just add the following to your pom.xml, substituting the version number for the latest and greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<h3 id="BookDataFormatAppendix-Dependencies.3">Dependencies</h3><p>To use CSV in your Camel routes you need to add a dependency on <strong>camel-csv</strong>, which implements this data format.</p><p>If you use Maven you can just add the following to your pom.xml, substituting the version number for the latest and greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-csv</artifactId> @@ -808,7 +779,7 @@ from("jms://queue/order").unma ]]></script> </div></div> -<h3 id="BookDataFormatAppendix-Dependencies.5">Dependencies</h3> +<h3 id="BookDataFormatAppendix-Dependencies.4">Dependencies</h3> <p>This data format is provided in <strong>camel-core</strong> so no additional dependencies is needed.</p> <h3 id="BookDataFormatAppendix-HL7DataFormat">HL7 DataFormat</h3> @@ -905,7 +876,7 @@ from("seda:people").marshal(df </div></div> <p>In the code above we marshal the data from a Object representation as a <code>List</code> of rows as <code>Maps</code>. The rows as <code>Map</code> contains the column name as the key, and the the corresponding value. This structure can be created in Java code from e.g. a processor. We marshal the data according to the Flatpack format and convert the result as a <code>String</code> object and store it on a JMS queue.</p> -<h3 id="BookDataFormatAppendix-Dependencies.6">Dependencies</h3> +<h3 id="BookDataFormatAppendix-Dependencies.5">Dependencies</h3> <p>To use Flatpack in your camel routes you need to add the a dependency on <strong>camel-flatpack</strong> which implements this data format. </p> @@ -1155,7 +1126,7 @@ from("activemq:queue:MY_QUEUE" ]]></script> </div></div> -<h3 id="BookDataFormatAppendix-Dependencies.7">Dependencies</h3> +<h3 id="BookDataFormatAppendix-Dependencies.6">Dependencies</h3> <p>This data format is provided in <strong>camel-core</strong> so no additional dependencies is needed.</p> <h2 id="BookDataFormatAppendix-TidyMarkup">TidyMarkup</h2> @@ -1201,7 +1172,7 @@ from("file://site/inbox").unma </div></div> -<h3 id="BookDataFormatAppendix-Dependencies.8">Dependencies</h3> +<h3 id="BookDataFormatAppendix-Dependencies.7">Dependencies</h3> <p>To use TidyMarkup in your camel routes you need to add the a dependency on <strong>camel-tagsoup</strong> which implements this data format. </p> @@ -2401,7 +2372,7 @@ public class Security { ]]></script> </div></div> -<h3 id="BookDataFormatAppendix-UsingtheJavaDSL.1">Using the Java DSL</h3> +<h3 id="BookDataFormatAppendix-UsingtheJavaDSL.2">Using the Java DSL</h3> <p>The next step consists in instantiating the DataFormat <em>bindy</em> class associated with this record type and providing Java package name(s) as parameter.</p> @@ -2712,7 +2683,7 @@ public class BindyComplexCsvUnmarshallTe </div> -<h3 id="BookDataFormatAppendix-Dependencies.9">Dependencies</h3> +<h3 id="BookDataFormatAppendix-Dependencies.8">Dependencies</h3> <p>To use Bindy in your camel routes you need to add the a dependency on <strong>camel-bindy</strong> which implements this data format.</p> @@ -2925,7 +2896,7 @@ context.addRoutes(new RouteBuilder() { ]]></script> </div></div> -<h3 id="BookDataFormatAppendix-Dependencies.10">Dependencies</h3> +<h3 id="BookDataFormatAppendix-Dependencies.9">Dependencies</h3> <p>This data format is provided within the <strong>camel-xmlsecurity</strong> component.</p> The GZip <a shape="rect" href="data-format.html">Data Format</a> is a message compression and de-compression format. It uses the same deflate algorithm that is used in <a shape="rect" href="zip-dataformat.html">Zip DataFormat</a>, although some additional headers are provided. This format is produced by popular <code>gzip</code>/<code>gunzip</code> tool. Messages marshalled using GZip compression can be unmarshalled using GZip decompression just prior to being consumed at the endpoint. The compression capability is quite useful when you deal with large XML and Text based payloads or when you read messages previously comressed using <code>gzip</code> tool. @@ -2952,7 +2923,7 @@ from("activemq:queue:MY_QUEUE" ]]></script> </div></div> -<h3 id="BookDataFormatAppendix-Dependencies.11">Dependencies</h3> +<h3 id="BookDataFormatAppendix-Dependencies.10">Dependencies</h3> <p>This data format is provided in <strong>camel-core</strong> so no additional dependencies is needed.</p> <h2 id="BookDataFormatAppendix-Castor">Castor</h2> @@ -2962,7 +2933,7 @@ from("activemq:queue:MY_QUEUE" <p>As usually you can use either Java DSL or Spring XML to work with Castor Data Format. </p> -<h3 id="BookDataFormatAppendix-UsingtheJavaDSL.2">Using the Java DSL</h3> +<h3 id="BookDataFormatAppendix-UsingtheJavaDSL.3">Using the Java DSL</h3> <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ from("direct:order"). @@ -3067,7 +3038,7 @@ castor.getUnmarshaller(); <div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Option </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Type </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> encoding </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> String </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> UTF-8 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Encoding to use when marshalling an Object to XML </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> validation </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Boolean </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> false </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Whether validation is turned on or off. </p></td> </tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> mappingFile </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> String </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> null </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Path to a Castor mapping file to load from the classpath. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> packages </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> String[] </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> null </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Add additional packages to Castor XmlContext </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> classNames </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> String[] </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> null </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Add additional class names to Castor XmlContext </p></td></t r></tbody></table></div> -<h3 id="BookDataFormatAppendix-Dependencies.12">Dependencies</h3> +<h3 id="BookDataFormatAppendix-Dependencies.11">Dependencies</h3> <p>To use Castor in your camel routes you need to add the a dependency on <strong>camel-castor</strong> which implements this data format. </p> @@ -3194,7 +3165,7 @@ message AddressBook { ]]></script> </div></div> -<h3 id="BookDataFormatAppendix-Dependencies.13">Dependencies</h3> +<h3 id="BookDataFormatAppendix-Dependencies.12">Dependencies</h3> <p>To use Protobuf in your camel routes you need to add the a dependency on <strong>camel-protobuf</strong> which implements this data format. </p> @@ -3243,7 +3214,7 @@ message AddressBook { <p>If you have generated the web service stub code with cxf-codegen or a similar tool then you probably will want to use the ServiceInterfaceStrategy. In the case you have no annotated service interface you should use QNameStrategy or TypeNameStrategy.</p> -<h3 id="BookDataFormatAppendix-UsingtheJavaDSL.3">Using the Java DSL</h3> +<h3 id="BookDataFormatAppendix-UsingtheJavaDSL.4">Using the Java DSL</h3> <p>The following example uses a named DataFormat of <em>soap</em> which is configured with the package com.example.customerservice to initialize the <a shape="rect" class="external-link" href="http://java.sun.com/javase/6/docs/api/javax/xml/bind/JAXBContext.html" rel="nofollow">JAXBContext</a>. The second parameter is the ElementNameStrategy. The route is able to marshal normal objects as well as exceptions. (Note the below just sends a SOAP Envelope to a queue. A web service provider would actually need to be listening to the queue for a SOAP call to actually occur, in which case it would be a one way SOAP request. If you need request reply then you should look at the next example.)</p> @@ -3412,7 +3383,7 @@ from("jms://queue:customerServiceQu ]]></script> </div></div> -<h3 id="BookDataFormatAppendix-Dependencies.14">Dependencies</h3> +<h3 id="BookDataFormatAppendix-Dependencies.13">Dependencies</h3> <p>To use the SOAP dataformat in your camel routes you need to add the following dependency to your pom.</p> @@ -3688,7 +3659,7 @@ from("direct:start") ... .marshal(pgpSignAndEncryptSeveralSignerKeys) ... ]]></script> -</div></div><h3 id="BookDataFormatAppendix-SupportofSub-KeysandKeyFlagsinPGPDataFormatMarshaler">Support of Sub-Keys and Key Flags in PGP Data Format Marshaler</h3><p>Since <strong>Camel 2.12.3.<br clear="none"></strong>An <a shape="rect" class="external-link" href="https://tools.ietf.org/html/rfc4880#section-12.1" rel="nofollow">OpenPGP V4 key</a> can have a primary key and sub-keys. The usage of the keys is indicated by the so called <a shape="rect" class="external-link" href="https://tools.ietf.org/html/rfc4880#section-5.2.3.21" rel="nofollow">Key Flags</a>. For example, you can have a primary key with two sub-keys; the primary key shall only be used for certifying other keys (Key Flag 0x01), the first sub-key  shall only be used for signing (Key Flag 0x02), and the second sub-key shall only be used for encryption (Key Flag 0x04 or 0x08). The PGP Data Format marshaler takes into account these Key Flags of the primary key and sub-keys in order to determine the right key for signing and encryption. This is necessary because the primary key and its sub-keys have the same User IDs.</p><h3 id="BookDataFormatAppendix-SupportofCustomKeyAccessors">Support of Custom Key Accessors</h3><p>Since <strong>Camel 2.13.0.<br clear="none"></strong>You can implement custom key accessors for encryption/signing. The above PGPDataFormat class selects in a certain predefined way the keys which should be used for signing/encryption or verifying/decryption. If you have special requirements how your keys should be selected you should use the <a shape="rect" class="external-link" href="https://github.com/apache/camel/blob/master/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPKeyAccessDataFormat.java" rel="nofollow">PGPKeyAccessDataFormat</a> class instead and implement the interfaces <a shape="rect" class="external-link" href="https://github.com/apache/camel/blob/master/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPPu blicKeyAccessor.java" rel="nofollow">PGPPublicKeyAccessor</a> and <a shape="rect" class="external-link" href="https://github.com/apache/camel/blob/master/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPSecretKeyAccessor.java" rel="nofollow">PGPSecretKeyAccessor</a> as beans. There are default implementations <a shape="rect" class="external-link" href="https://github.com/apache/camel/blob/master/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/DefaultPGPPublicKeyAccessor.java" rel="nofollow">DefaultPGPPublicKeyAccessor</a> and <a shape="rect" class="external-link" href="https://github.com/apache/camel/blob/master/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/DefaultPGPSecretKeyAccessor.java" rel="nofollow">DefaultPGPSecretKeyAccessor</a> which cache the keys, so that not every time the keyring is parsed when the processor is called.</p><p>PGPKeyAccessDataFormat has the same options as PGPDataFormat except pas sword, keyFileName, encryptionKeyRing, signaturePassword, signatureKeyFileName, and signatureKeyRing.</p><h3 id="BookDataFormatAppendix-Dependencies.15">Dependencies</h3><p>To use the <a shape="rect" href="crypto.html">Crypto</a> dataformat in your camel routes you need to add the following dependency to your pom.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h3 id="BookDataFormatAppendix-SupportofSub-KeysandKeyFlagsinPGPDataFormatMarshaler">Support of Sub-Keys and Key Flags in PGP Data Format Marshaler</h3><p>Since <strong>Camel 2.12.3.<br clear="none"></strong>An <a shape="rect" class="external-link" href="https://tools.ietf.org/html/rfc4880#section-12.1" rel="nofollow">OpenPGP V4 key</a> can have a primary key and sub-keys. The usage of the keys is indicated by the so called <a shape="rect" class="external-link" href="https://tools.ietf.org/html/rfc4880#section-5.2.3.21" rel="nofollow">Key Flags</a>. For example, you can have a primary key with two sub-keys; the primary key shall only be used for certifying other keys (Key Flag 0x01), the first sub-key  shall only be used for signing (Key Flag 0x02), and the second sub-key shall only be used for encryption (Key Flag 0x04 or 0x08). The PGP Data Format marshaler takes into account these Key Flags of the primary key and sub-keys in order to determine the right key for signing and encryption. This is necessary because the primary key and its sub-keys have the same User IDs.</p><h3 id="BookDataFormatAppendix-SupportofCustomKeyAccessors">Support of Custom Key Accessors</h3><p>Since <strong>Camel 2.13.0.<br clear="none"></strong>You can implement custom key accessors for encryption/signing. The above PGPDataFormat class selects in a certain predefined way the keys which should be used for signing/encryption or verifying/decryption. If you have special requirements how your keys should be selected you should use the <a shape="rect" class="external-link" href="https://github.com/apache/camel/blob/master/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPKeyAccessDataFormat.java" rel="nofollow">PGPKeyAccessDataFormat</a> class instead and implement the interfaces <a shape="rect" class="external-link" href="https://github.com/apache/camel/blob/master/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPPu blicKeyAccessor.java" rel="nofollow">PGPPublicKeyAccessor</a> and <a shape="rect" class="external-link" href="https://github.com/apache/camel/blob/master/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPSecretKeyAccessor.java" rel="nofollow">PGPSecretKeyAccessor</a> as beans. There are default implementations <a shape="rect" class="external-link" href="https://github.com/apache/camel/blob/master/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/DefaultPGPPublicKeyAccessor.java" rel="nofollow">DefaultPGPPublicKeyAccessor</a> and <a shape="rect" class="external-link" href="https://github.com/apache/camel/blob/master/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/DefaultPGPSecretKeyAccessor.java" rel="nofollow">DefaultPGPSecretKeyAccessor</a> which cache the keys, so that not every time the keyring is parsed when the processor is called.</p><p>PGPKeyAccessDataFormat has the same options as PGPDataFormat except pas sword, keyFileName, encryptionKeyRing, signaturePassword, signatureKeyFileName, and signatureKeyRing.</p><h3 id="BookDataFormatAppendix-Dependencies.14">Dependencies</h3><p>To use the <a shape="rect" href="crypto.html">Crypto</a> dataformat in your camel routes you need to add the following dependency to your pom.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-crypto</artifactId>