Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 98d6b53e11e983e268c3e19f14e091a0 > files > 510

kdepim-devel-doc-3.5.9-9mdv2008.1.x86_64.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US">

<head>
  <title>certmanager/lib: StructuringInfoWrapper Class Reference (certmanager/lib)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <meta http-equiv="Content-Style-Type" content="text/css" />

  <meta http-equiv="pics-label" content='(pics-1.1 "http://www.icra.org/ratingsv02.html" comment "ICRAonline DE v2.0" l gen true for "http://www.kde.org"  r (nz 1 vz 1 lz 1 oz 1 cb 1) "http://www.rsac.org/ratingsv01.html" l gen true for "http://www.kde.org"  r (n 0 s 0 v 0 l 0))' />

  <meta name="trademark" content="KDE e.V." />
  <meta name="description" content="K Desktop Environment Homepage, KDE.org" />
  <meta name="MSSmartTagsPreventParsing" content="true" />
  <meta name="robots" content="all" />

  <link rel="shortcut icon" href="../../../favicon.ico" />

<link rel="stylesheet" media="screen" type="text/css" title="APIDOX" href="doxygen.css" />



<style type="text/css">
<!--
hr { display: none; }
#content h2 { margin-left: 0px; }
table.mdTable { background-color: #f8f8f8; border: .2em solid #d7d7d7; }
td.mdRow { padding: 8px 20px; }
td.md { font-weight: bold; }
td.mdname1 { font-weight: bold; color: #602020; }
td.mdname { font-weight: bold; color: #602020;  }

-->
</style>

</head>

<body>

<div id="nav_header_top" align="right">
  <a href="#content" class="doNotDisplay" accesskey="2">Skip to main content ::</a>

  <a href="../../.."><img id="nav_header_logo" alt="Home" align="left" src="../../../kde_gear_64.png" border="0" /></a>
  <span class="doNotDisplay">::</span>
  <img id="nav_header_logo_right" alt="" align="right" src="../../../pimlogo.png" border="0" />

  <div id="nav_header_title" align="left">KDE PIM API Reference</div>


</div>

<div id="nav_header_bottom" align="right">
  <span class="doNotDisplay">:: <a href="#navigation" accesskey="5">Skip to Link Menu</a><br/></span>
  <div id="nav_header_bottom_left" style="text-align: left;">
/ <a href="../../../">API Reference</a>
 / <a href="../../html/index.html">certmanager</a> / <a href=".">lib</a>
  </div>
</div>


<table id="main" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
      <td valign="top" class="menuheader" height="0"></td>

  <td id="contentcolumn" valign="top" rowspan="2" >
    <div id="content" style="padding-top: 0px;"><div style="width:100%; margin: 0px; padding: 0px;">
    <h2><a name="content"></a>certmanager/lib</h2>


<!-- Generated by Doxygen 1.5.5 -->
<div class="contents">
<h1>StructuringInfoWrapper Class Reference<br>
<small>
[<a class="el" href="group__groupSignCryptAct.html">Signing and Encrypting Actions</a>]</small>
</h1><!-- doxytag: class="StructuringInfoWrapper" --><code>#include &lt;<a class="el" href="cryptplugwrapper_8h-source.html">cryptplugwrapper.h</a>&gt;</code>
<p>

<p>
<a href="classStructuringInfoWrapper-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
This class provides C++ access to the StructuringInfo helper struct that is specified in <a class="el" href="cryptplug_8h.html" title="Common API header for CRYPTPLUG.">cryptplug.h</a> to hold information returned by signing and by encrypting functions. 
<p>
Use this information to compose a MIME object containing signed and/or encrypted content (or to build a text frame around your flat non-MIME message body, resp.)<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>This class is different from the respective <a class="el" href="cryptplug_8h.html" title="Common API header for CRYPTPLUG.">cryptplug.h</a> class because this one takes care for freeing the char** members' memory automatically. You must <b>not</b> call the <code>free</code> function for any of it's members - just ignore the advise given in the <a class="el" href="cryptplug_8h.html" title="Common API header for CRYPTPLUG.">cryptplug.h</a> documentation!</dd></dl>
<b>If</b> value returned in <code>makeMimeObject</code> is <b>TRUE</b> the text strings returned in <code>contentTypeMain</code> and <code>contentDispMain</code> and <code>contentTEncMain</code> (and, if required, <code>content</code>[..]Version and <code>bodyTextVersion</code> and <code>content</code>[..]Sig) should be used to compose a respective MIME object.<br>
 If <b>FALSE</b> the texts returned in <code>flatTextPrefix</code> and <code>flatTextSeparator</code> and <code>flatTextPostfix</code> are to be used instead.<br>
 Always <b>either</b> the <code>content</code>[..] and <code>bodyTextVersion</code> parameters <b>or</b> the <code>flatText</code>[..] parameters are holding valid data - never both of them may be used simultaneously as plugins will just ignore the parameters not matching their <code>makeMimeObject</code> setting.<p>
When creating your MIME object please observe these common rules: <ul>
<li>Parameters named <code>contentType</code>[..] and <code>contentDisp</code>[..] and <code>contentTEnc</code>[..] will return the values for the respective MIME headers 'Content-Type' and 'Content-Disposition' and 'Content-Transfer-Encoding'. The following applies to these parameters: </li>
<li>The relevant MIME part may <b>only</b> be created if the respective <code>contentType</code>[..] parameter is holding a non-zero-length string. If the <code>contentType</code>[..] parameter value is invalid or holding an empty string the respective <code>contentDisp</code>[..] and <code>contentTEnc</code>[..] parameters should be ignored. </li>
<li>If the respective <code>contentDisp</code>[..] or <code>contentTEnc</code>[..] parameter is NULL or holding a zero-length string it is up to you whether you want to add the relevant MIME header yourself, but since it in in the responsibility of the plugin implementors to provide you with all necessary 'Content-[..]' header information you should <b>not need</b> to define them if they are not returned by the signing or encrypting function - otherwise this may be considered as a bug in the plugin and you could report the missing MIME header information to the address returned by the <code>bugURL()</code> function.</li>
</ul>
If <code>makeMultiMime</code> returns FALSE the <code>contentTypeMain</code> returned must not be altered but used to specify a single part mime object holding the code bloc, e.g. this is used for 'enveloped-data' single part MIME objects. In this case you should ignore both the <code>content</code>[..]Version and <code>content</code>[..]Code parameters.<p>
If <code>makeMultiMime</code> returns TRUE also the following rules apply: <ul>
<li>If <code>includeCleartext</code> is TRUE you should include the cleartext as first part of our multipart MIME object, typically this is TRUE when signing mails but FALSE when encrypting. </li>
<li>The <code>contentTypeMain</code> returned typically starts with "multipart/" while providing a "protocol" and a "micalg" parameter: just add an appropriate <code>"; boundary=[your \c boundary \c string]"</code> to get the complete Content-Type value to be used for the MIME object embedding both the signed part and the signature part (or - in case of encrypting - the version part and the code part, resp.). </li>
<li>If <code>contentTypeVersion</code> is holding a non-zero-length string an additional MIME part must added immediately before the code part, this version part's MIME headers must have the unaltered values of <code>contentTypeVersion</code> and (if they are holding non-zero-length strings) <code>contentDispVersion</code> and <code>contentTEncVersion</code>, the unaltered contents of <code>bodyTextVersion</code> must be it's body. </li>
<li>The value returned in <code>contentTypeCode</code> is specifying the complete Content-Type to be used for this multipart MIME object's signature part (or - in case of encrypting - for the code part following after the version part, resp.), you should not add/change/remove anything here but just use it's unaltered value for specifying the Content-Type header of the respective MIME part. </li>
<li>The same applies to the <code>contentDispCode</code> value: just use it's unaltered value to specify the Content-Disposition header entry of the respective MIME part. </li>
<li>The same applies to the <code>contentTEncCode</code> value: just use it's unaltered value to specify the Content-Transfer-Encoding header of the respective MIME part.</li>
</ul>
<b>If</b> value returned in <code>makeMimeObject</code> is <b>FALSE</b> the text strings returned in <code>flatTextPrefix</code> and <code>flatTextPostfix</code> should be used to build a frame around the cleartext and the code bloc holding the signature (or - in case of encrypting - the encoded data bloc, resp.).<br>
 If <code>includeCleartext</code> is TRUE this frame should also include the cleartext as first bloc, this bloc should be divided from the code bloc by the contents of <code>flatTextSeparator</code> - typically this is used for signing but not when encrypting.<br>
 If <code>includeCleartext</code> is FALSE you should ignore both the cleartext and the <code>flatTextSeparator</code> parameter.<p>
<b>How to use <a class="el" href="classStructuringInfoWrapper.html" title="This class provides C++ access to the StructuringInfo helper struct that is specified...">StructuringInfoWrapper</a> data in your program:</b> <ul>
<li>To compose a signed message please act as described below. </li>
<li>For constructing an encrypted message just replace the <code>signMessage()</code> call by the respective <code>encryptMessage()</code> call and then proceed exactly the same way. </li>
<li>In any case make <b>sure</b> to free your <code>ciphertext</code> when you are done with processing the data returned by the signing (or encrypting, resp.) function.</li>
</ul>
<div class="fragment"><pre class="fragment">

    char* ciphertext;
    StructuringInfoWrapper structInf;

    if( ! signMessage( cleartext, &amp;ciphertext, certificate,
                      structInf ) ) {

        myErrorDialog( "Error: could not sign the message!" );

    } else {
      if( structInf.data.makeMimeObject ) {

        // Build the main MIME object.
        // This is done by
        // using the header values returned in
        // structInf.data.contentTypeMain and in
        // structInf.data.contentDispMain and in
        // structInf.data.contentTEncMain.
        ..

        if( ! structInf.data.makeMultiMime ) {

          // Build the main MIME object's body.
          // This is done by
          // using the code bloc returned in
          // ciphertext.
          ..

        } else {

          // Build the encapsulated MIME parts.
          if( structInf.data.includeCleartext ) {

            // Build a MIME part holding the cleartext.
            // This is done by
            // using the original cleartext's headers and by
            // taking it's original body text.
            ..

          }
          if(    structInf.data.contentTypeVersion
              &amp;&amp; 0 &lt; strlen( structInf.data.contentTypeVersion ) ) {

            // Build a MIME part holding the version information.
            // This is done by
            // using the header values returned in
            // structInf.data.contentTypeVersion and
            // structInf.data.contentDispVersion and
            // structInf.data.contentTEncVersion and by
            // taking the body contents returned in
            // structInf.data.bodyTextVersion.
            ..

          }
          if(    structInf.data.contentTypeCode
              &amp;&amp; 0 &lt; strlen( structInf.data.contentTypeCode ) ) {

            // Build a MIME part holding the code information.
            // This is done by
            // using the header values returned in
            // structInf.data.contentTypeCode and
            // structInf.data.contentDispCode and
            // structInf.data.contentTEncCode and by
            // taking the body contents returned in
            // ciphertext.
            ..

          } else {

            // Plugin error!
            myErrorDialog( "Error: Cryptography plugin returned a main"
                          "Content-Type=Multipart/.. but did not "
                          "specify the code bloc's Content-Type header."
                          "\nYou may report this bug:"
                          "\n" + cryptplug.bugURL() );
          }
        }
      } else  {

        // Build a plain message body
        // based on the values returned in structInf.
        // Note: We do _not_ insert line breaks between the parts since
        //       it is the plugin job to provide us with ready-to-use
        //       texts containing all necessary line breaks.
        strcpy( myMessageBody, structInf.data.plainTextPrefix );
        if( structInf.data.includeCleartext ) {
          strcat( myMessageBody, cleartext );
          strcat( myMessageBody, structInf.data.plainTextSeparator );
        }
        strcat( myMessageBody, *ciphertext );
        strcat( myMessageBody, structInf.data.plainTextPostfix );
      }

      // free the memory that was allocated
      // for the ciphertext
      free( ciphertext );
    }

</pre></div><p>
<dl class="see" compact><dt><b>See also:</b></dt><dd>signMessage, encryptMessage, encryptAndSignMessage </dd></dl>

<p>Definition at line <a class="el" href="cryptplugwrapper_8h-source.html#l00435">435</a> of file <a class="el" href="cryptplugwrapper_8h-source.html">cryptplugwrapper.h</a>.</p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5eab51c7ef32ada14f8adac7fe2f2893"></a><!-- doxytag: member="StructuringInfoWrapper::StructuringInfoWrapper" ref="5eab51c7ef32ada14f8adac7fe2f2893" args="(CryptPlugWrapper *wrapper)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><b>StructuringInfoWrapper</b> (<a class="el" href="classCryptPlugWrapper.html">CryptPlugWrapper</a> *wrapper)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0d93d1f42bc1f431a8da978e179a78f1"></a><!-- doxytag: member="StructuringInfoWrapper::reset" ref="0d93d1f42bc1f431a8da978e179a78f1" args="()" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>reset</b> ()</td></tr>

<tr><td colspan="2"><br><h2>Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="52b3f6a0c11dfda68e8b71960bb9c330"></a><!-- doxytag: member="StructuringInfoWrapper::data" ref="52b3f6a0c11dfda68e8b71960bb9c330" args="" -->
<a class="el" href="structCryptPlug_1_1StructuringInfo.html">CryptPlug::StructuringInfo</a>&nbsp;</td><td class="memItemRight" valign="bottom"><b>data</b></td></tr>

</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="cryptplugwrapper_8h-source.html">cryptplugwrapper.h</a><li><a class="el" href="cryptplugwrapper_8cpp-source.html">cryptplugwrapper.cpp</a></ul>
</div>
    </div></div>


      </td>
  </tr>
  <tr>
    <td valign="top" id="leftmenu" width="25%">
      <a name="navigation"></a>
      <div class="menu_box"><h2>certmanager/lib</h2>
<div class="nav_list">
<ul><li><a href="index.html">Main Page</a></li><li><a href="modules.html">Modules</a></li><li><a href="hierarchy.html">Class Hierarchy</a></li><li><a href="classes.html">Alphabetical List</a></li><li><a href="annotated.html">Class List</a></li><li><a href="files.html">File List</a></li><li><a href="functions.html">Class Members</a></li></ul>
<!--
<h2>Class Picker</h2>
<div style="text-align: center;">
<form name="guideform">
<select name="guidelinks" style="width:100%;" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value">
<option value="annotated.html">-- Choose --</option>
  <option value="classCryptPlugWrapper.html">cryptplugwrapper</option>,  <option value="classKleo_1_1ChiasmusJob.html">kleo::chiasmusjob</option>,  <option value="classKleo_1_1ChiasmusLibrary.html">kleo::chiasmuslibrary</option>,  <option value="classKleo_1_1CryptoConfig.html">kleo::cryptoconfig</option>,  <option value="classKleo_1_1CryptoConfigComponent.html">kleo::cryptoconfigcomponent</option>,  <option value="classKleo_1_1CryptoConfigDialog.html">kleo::cryptoconfigdialog</option>,  <option value="classKleo_1_1CryptoConfigEntry.html">kleo::cryptoconfigentry</option>,  <option value="classKleo_1_1CryptoConfigGroup.html">kleo::cryptoconfiggroup</option>,  <option value="classKleo_1_1CryptoConfigModule.html">kleo::cryptoconfigmodule</option>,  <option value="classKleo_1_1DecryptJob.html">kleo::decryptjob</option>,  <option value="classKleo_1_1DecryptVerifyJob.html">kleo::decryptverifyjob</option>,  <option value="classKleo_1_1DeleteJob.html">kleo::deletejob</option>,  <option value="classKleo_1_1DN.html">kleo::dn</option>,  <option value="classKleo_1_1DNAttributeMapper.html">kleo::dnattributemapper</option>,  <option value="classKleo_1_1DownloadJob.html">kleo::downloadjob</option>,  <option value="classKleo_1_1EncryptJob.html">kleo::encryptjob</option>,  <option value="classKleo_1_1ExportJob.html">kleo::exportjob</option>,  <option value="classKleo_1_1GnuPGProcessBase.html">kleo::gnupgprocessbase</option>,  <option value="classKleo_1_1HierarchicalKeyListJob.html">kleo::hierarchicalkeylistjob</option>,  <option value="classKleo_1_1ImportJob.html">kleo::importjob</option>,  <option value="classKleo_1_1Job.html">kleo::job</option>,  <option value="classKleo_1_1KeyFilter.html">kleo::keyfilter</option>,  <option value="classKleo_1_1KeyGenerationJob.html">kleo::keygenerationjob</option>,  <option value="classKleo_1_1KeyListJob.html">kleo::keylistjob</option>,  <option value="classKleo_1_1KeyRequester.html">kleo::keyrequester</option>,  <option value="classKleo_1_1MultiDeleteJob.html">kleo::multideletejob</option>,  <option value="classKleo_1_1ObtainKeysJob.html">kleo::obtainkeysjob</option>,  <option value="classKleo_1_1ProgressBar.html">kleo::progressbar</option>,  <option value="classKleo_1_1ProgressDialog.html">kleo::progressdialog</option>,  <option value="classKleo_1_1QGpgMEJob.html">kleo::qgpgmejob</option>,  <option value="classKleo_1_1RefreshKeysJob.html">kleo::refreshkeysjob</option>,  <option value="classKleo_1_1SignEncryptJob.html">kleo::signencryptjob</option>,  <option value="classKleo_1_1SignJob.html">kleo::signjob</option>,  <option value="classKleo_1_1SpecialJob.html">kleo::specialjob</option>,  <option value="classKleo_1_1VerifyDetachedJob.html">kleo::verifydetachedjob</option>,  <option value="classKleo_1_1VerifyOpaqueJob.html">kleo::verifyopaquejob</option>,  <option value="classQGpgMECryptoConfig.html">qgpgmecryptoconfig</option>,  <option value="classQGpgMECryptoConfigComponent.html">qgpgmecryptoconfigcomponent</option>,  <option value="classStructuringInfoWrapper.html">structuringinfowrapper</option>,
</select>
</form>
</div>
-->
</div></div>
<div class="menu_box"><h2>API Dox</h2>
<div class="nav_list">
<ul>
<li><a href="../../../akregator/html/index.html">akregator</a></li><li>&nbsp;&nbsp;<a href="../../../akregator/src/html/index.html">src</a></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../../akregator/src/librss/html/index.html">librss</a></li><li><a href="../../../certmanager/html/index.html">certmanager</a></li><li>&nbsp;&nbsp;<a href="../../../certmanager/lib/html/index.html">lib</a></li><li><a href="../../../kaddressbook/html/index.html">kaddressbook</a></li><li><a href="../../../kalarm/html/index.html">kalarm</a></li><li>&nbsp;&nbsp;<a href="../../../kalarm/lib/html/index.html">lib</a></li><li><a href="../../../kandy/html/index.html">kandy</a></li><li><a href="../../../karm/html/index.html">karm</a></li><li><a href="../../../kdgantt/html/index.html">kdgantt</a></li><li><a href="../../../kgantt/html/index.html">kgantt</a></li><li><a href="../../../kioslaves/html/index.html">kioslaves</a></li><li>&nbsp;&nbsp;<a href="../../../kioslaves/imap4/html/index.html">imap4</a></li><li>&nbsp;&nbsp;<a href="../../../kioslaves/mbox/html/index.html">mbox</a></li><li><a href="../../../kitchensync/html/index.html">kitchensync</a></li><li><a href="../../../kmail/html/index.html">kmail</a></li><li><a href="../../../knotes/html/index.html">knotes</a></li><li><a href="../../../konsolekalendar/html/index.html">konsolekalendar</a></li><li><a href="../../../kontact/html/index.html">kontact</a></li><li><a href="../../../korganizer/html/index.html">korganizer</a></li><li><a href="../../../kpilot/html/index.html">kpilot</a></li><li>&nbsp;&nbsp;<a href="../../../kpilot/kpilot/html/index.html">kpilot</a></li><li>&nbsp;&nbsp;<a href="../../../kpilot/lib/html/index.html">lib</a></li><li><a href="../../../libemailfunctions/html/index.html">libemailfunctions</a></li><li><a href="../../../libkcal/html/index.html">libkcal</a></li><li><a href="../../../libkdepim/html/index.html">libkdepim</a></li><li><a href="../../../libkholidays/html/index.html">libkholidays</a></li><li><a href="../../../libkmime/html/index.html">libkmime</a></li><li><a href="../../../libkpgp/html/index.html">libkpgp</a></li><li><a href="../../../libkpimidentities/html/index.html">libkpimidentities</a></li>
</ul></div></div>


        </td>
</tr>
</table>

<span class="doNotDisplay">
  <a href="http://www.kde.org/" accesskey="8">KDE Home</a> |
  <a href="http://accessibility.kde.org/" accesskey="9">KDE Accessibility Home</a> |
  <a href="http://www.kde.org/media/accesskeys.php" accesskey="0">Description of Access Keys</a>
</span>


<div style="height: 8px"></div>

<div id="footer">
  <div id="footer_left">
    Maintained by <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;groo&#116;&#64;kde&#46;or&#x67;">Adriaan de Groot</a>
and
<a href="&#109;a&#105;&#108;&#116;&#111;&#58;w&#105;nter&#64;kde&#46;or&#x67">Allen Winter</a>.
<br/>
    KDE and K Desktop Environment are trademarks of <a href="http://www.kde.org/areas/kde-ev/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> |
    <a href="http://www.kde.org/contact/impressum.php">Legal</a>
  </div>
  <div id="footer_right"><img src="/media/images/footer_right.png" style="margin: 0px" alt="" /></div>
</div>

<!--
WARNING: DO NOT SEND MAIL TO THE FOLLOWING EMAIL ADDRESS! YOU WILL
BE BLOCKED INSTANTLY AND PERMANENTLY!
<a href="mailto:aaaatrap-425acc3b5374943f@kde.org">Block me</a>
WARNING END
-->

</body>
</html>