# Manual de &kleopatra;

## Introdución

&kleopatra; is the &kde; tool for managing X.509 and OpenPGP certificates in the &gpgsm; and &gpg; keyboxes and for retrieving certificates from &ldap; and other certificate servers.

&kleopatra; can be started from &kmail;'s Tools Certificate Manager menu, as well as from the command line. The &kleopatra; executable is named ``kleopatra``.

This program is named after Cleopatra, a famous female Egyptian pharaoh that lived at the time of Julius Caesar, with whom she had a child, Caesarion, unacknowledged as his heir.

O nome escolleuse porque este programa ten a súa orixe nos Proxectos Ägypten (Ägypten é Exipto en alemán). &kleopatra; é como se escribe Cleopatra en alemán.

## Funcións principais

### Ver a caixa de chaves local

A función principal do &kleopatra; é mostrar e modificr o contido da caixa de chaves local, que é un concepto semellante aos chaveiros de &gpg;, ainda que non conveña estender demasiado esta analoxía.

The main window is divided into the large key listing area consisting of several tabs, the menubar and the search bar on top, and a status bar at the bottom.

Cada liña da listaxe de chaves corresponde a un certificado, que se identifica polo chamado &dn; do suxeito. &dn; é un acrónimo de Nome Distinguido, un identificador xerárquico moi semellante a un camiño nun sistema de ficheiros cunha sintaxe diferente, que permite identificar un certificado dado de forma unívoca e global.

To be valid, and thus usable, (public) keys need to be signed by a &ca; (Certification Authority). These signatures are called certificates, but usually the terms certificate and (public) key are used interchangeably, and we will not distinguish between them in this manual either, except when explicitly noted.

As &ca; deben, pola súa vez, ser asinadas por outras &ca; para seren válidas. Obviamente isto debe parar nalgures, polo que a &ca; de nivel superior (&ca; raiz) asina a súa chave consigo mesma (isto chámase auto-sinatura). En consecuencia, para os certificados raiz hai que asginarlles unha validez (chamada normalmente confianza) manualmente). ⪚ despois de comparar a pegada coa do sitio web da &ca;. Isto faino normalmente o administrador do sistema ou o vendedor do produto que emprega os certificados, mais tamén o pode facer o usuario mediante a interface de liña de comandos do &gpgsm;.

To see which of the certificates are root certificates, you switch to the hierarchical keylist mode with view-hierarchical-key-list.

You can see the details of any certificate by double-clicking it or using view-certificate-details. This opens a dialog that shows the most common properties of the certificate, its certificate chain (&ie; the chain of issuers up to the root-&ca;), and a dump of all information the backend is able to extract from the certificate.

If you change the keybox without using &kleopatra; (⪚ using &gpgsm;'s command line interface), you can refresh the view with view-redisplay.

### Procurar e importar certificados

Most of the time, you will acquire new certificates by verifying signatures in emails, since certificates are embedded in the signatures made using them most of the time. However, if you need to send a mail to someone you have not yet had contact with, you need to fetch the certificate from an &ldap; folder (although &gpgsm; can do this automatically), or from a file. You also need to import your own certificate after receiving the &ca; answer to your certification request.

To search for a certificate in an &ldap; directory, select File Lookup Certificates on Server and enter some text (⪚ the name of the person you want the certificate for) into the line edit of the Keyserver Certificate Lookup dialog, then click on the Search button. The results will be displayed in the key list below the search bar, where you can select certificates to look at them by clicking the Details button or download them with Import into the local keybox.

You can configure the list of &ldap; servers to search in the Directory Services page of &kleopatra;'s configure dialog.

If you received the certificate as a file, try file-import-certificates. &gpgsm; needs to understand the format of the certificate file; please refer to &gpgsm;'s manual for a list of supported file formats.

If you did not create your keypair with &gpgsm;, you also need to manually import the public key (as well as the secret key) from the PKCS#12 file you got from the &ca;. You can do this on the command line with ``kleopatra `--import-certificate` `filename``` or from within &kleopatra; with file-import-certificates, just as you would to for normal certificates.

### Crear pares novos de chaves

The menu item file-new-key-pair starts the Certificate Creation Wizard which will guide you through a number of steps to create a certificate request.

Cando remate cun paso no asistente, prema Seguinte para o próximo paso (ou Atrás para revisar os pasos xa completados). A creación do pedido de certificado pódese cancelar en calquer momento premendo o botón Cancelar.

On the first page of the wizard choose which type of certificate you want to create:

Create a personal OpenPGP key pair

- OpenPGP key pairs are created locally, and certified by your friends and acquaintances. There is no central certification authority; instead, every individual creates a personal Web Of Trust by certifying other user's key pairs with his own certificate.

  You have to enter a Name, EMail and optional a Comment.

Create a personal X.509 key pair and certification request

- X.509 key pairs are created locally, but certified centrally by a certification authority (&ca;). &ca;s can certify other &ca;s, creating a central, hierarchical chain of trust.

  The next step in the wizard is to type in your personal data for the certificate. The fields to fill out are:

  - Common Name (CN): Your name;

  - Email address (EMAIL): Your email address; be sure to type this in correctly—this will be the address people will be sending mail to when they use your certificate.

  - Location (L): The town or city in which you live;

  - Organizational unit (OU): The organizational unit you are in (for example, "Logistics");

  - Organization (O): The organization you represent (for example, the company you work for);

  - Country code (C): The two letter code for the country in which you are living (for example, "US");

  O paso seguinte do asistente é seleccionar se almacenar o certificado nun ficheiro ou enviarllo directamente a unha &ca;. Terá que especificar o nome de ficheiro ou enderezo de correo electrónico ao que enviar o pedido de certificado.

## Referencia do menú

### File Menu

&Ctrl;N File New Certificate...

- Creates a new key pair (public and private) and allows to send the public part to a certification authority (&ca;) for signing. The resulting certificate is then sent back to you, or stored in an &ldap; server for you to download into your local keybox, where you can use it to sign and decrypt mails.

  This mode of operation is called decentralized key generation, since all keys are created locally. &kleopatra; (and &gpgsm;) do not support centralized key generation directly, but you can import the public/secret key bundle that you receive from the &ca; in PKCS#12 format via file-import-certificates.

&Ctrl;&Shift;I File Lookup Certificates on Server...

- Searches for, and imports, certificates from certificate servers into the local keybox. See functions-search for details.

  You need to have key servers configured for this to work. See configuration-directory-services for more details.

&Ctrl;I File Import Certificates...

- Imports certificates and/or secret keys from files into the local keybox. See functions-search for details.

  The format of the certificate file must be supported by &gpgsm;/&gpg;. Please refer to the &gpgsm; and &gpg; manuals for a list of supported formats.

&Ctrl;E File Export Certificates...

- Exports the selected certificates to a file.

  The filename extension you choose for the export file name determines the format of the export file:

  - For OpenPGP certificates, `gpg` and `pgp` will result in a binary file, whereas `asc` will result in an &ascii;-armored file.

  - For &smime; certificates, `der` will result in a binary, &der;-encoded file, whereas `pem` will result in an &ascii;-armored file.

  Unless multiple certificates are selected, &kleopatra; will propose ``fingerprint`.{asc,pem}` as the export file name.

  This function is only available when one or more certificates have been selected.

  This function exports only the public keys, even if the secret key is available. Use file-export-secret-key to export both public and secret keys into a file, but note that this is almost always a bad idea.

File Export Secret Key...

- Exports both the public and the secret key to a file.

  In the dialog that opens, you can choose an Output file name, and whether to create a binary or an &ascii;-armored export file (ASCII armor). When exporting &smime; secret keys, you can also choose the Passphrase charset. See the discussion of the `--p12-charset `charset`` option in the &gpgsm; manual for more details.

  This function is only available when exactly one certificate has been selected, and the secret key for that certificate is available.

  It should rarely be necessary to use this function, and if it is, it should be carefully planned. Planning the migration of a secret key involves choice of transport media and secure deletion of the key data on the old machine, as well as on the transport medium, among other things.

&Ctrl;&Shift;E File Export Certificates to Server...

- Publish the selected certificates on a keyserver (&openpgp; only).

  The certificate is sent to the certificate server configured for &openpgp; (cf. configuration-directory-services), if that is set, otherwise to `keys.gnupg.net`.

  This function is only available if at least one &openpgp; (and no &smime;) certificates have been selected.

  When OpenPGP certificates have been exported to a public directory server, it is nearly impossible to remove them again. Before exporting your certificate to a public directory server, make sure that you have created a revocation certificate so you can revoke the certificate if needed later.

  Most public &openpgp; certificate servers synchronize certificates amongst each other, so there is little point in sending to more than one.

  It can happen that a search on a certificate server turns up no results even though you just have sent your certificate there. This is because most public keyserver addresses use DNS round-robin to balance the load over multiple machines. These machines synchronize with each other, but usually only every 24 hours or so.

File Decrypt/Verify Files...

- Decrypts files and/or verifies signatures over files.

File Sign/Encrypt Files...

- Signs and/or encrypts files.

&Ctrl;W File Close

- Closes &kleopatra;'s main window. You can restore it from the system tray icon at any time.

&Ctrl;Q Ficheiro Sair

- Termina o &kleopatra;.

### View Menu

F5 View Redisplay

- Refreshes the certificate list.

  Using this function is usually not necessary, as &kleopatra; monitors the filesystem for changes and automatically refreshes the certificate list when needed.

&Esc; View Stop Operation

- Stops (cancels) all pending operations, ⪚ a search, keylisting, or a download.

  This function is only available if at least one operation is active.

  Due to backend limitations, sometimes operations will hang in such a way that this function won't be able to cancel them, right away, or at all.

  In such cases, the only way to restore order is to kill &scdaemon;, &dirmngr;, &gpgsm; and &gpg; processes, in that order, via the operating system tools (`top`, Windows Task-Manager, &etc;), until the operation get unblocked.

Vista Detalles do Certificado

- Mostra os detalles do certificado seleccionado nese momento.

  This function is only available if exactly one certificate is selected.

  Esta función tamén está disponíbel calcando directamente dúas veces no elemento correspondente da listaxe.

View Hierarchical Certificate List

- Toggles between hierarchical and flat certificate list mode.

  In hierarchical mode, certificates are arranged in issuer/subject relation, so it is easy to see which certification hierarchy a given certificate belongs to, but a given certificate is harder to find initially (though you can of course use the search bar).

  No modo simple, móstranse todos os certificados nunha lista normal, ordenada alfabeticamente. Neste modo resulta doado atopar un certificado determinado, mais non é directamente claro a que certificado raiz pertence.

  This function toggles hierarchical mode per tab, &ie; each tab has its own hierarchy state. This is so that you can have both a flat and a hierarchical listing at hand, each in its own tab.

  Hierarchical display is currently only implemented for &smime; certificates. There is disagreement amongst the developers regarding the correct way to display &openpgp; certificates hierarchically (basically, parent = signer or parent = signee).

&Ctrl;. Vista Expandir Todo

- Expande todos os elementos da lista na vista da lista de certificados, &ie; torna todos os elementos visíbeis.

  Este é o valor por omisión ao entrar no modo de lista de chaves xerárquico.

  Pódese, obviamente, expandir e fechar cada elemento individual por si só.

  This function is only available when view-hierarchical-key-list is on.

&Ctrl;, Vista Fechar Todo

- Fecha todos os elementos da lista da vista da lista de certificados, &ie; agocha todos os elementos menos os do nivel superior.

  Pódese, obviamente, expandir e fechar cada elemento individual por si só.

  This function is only available when view-hierarchical-key-list is on.

### Certificates Menu

Certificates Change Owner Trust...

- Changes the Owner Trust of the selected &openpgp; certificate.

  This function is only available when exactly one &openpgp; certificate is selected.

Certificates Trust Root Certificate

- Marks this (&smime;) root certificate as trusted.

  In some ways, this is the equivalent of certificates-change-owner-trust for &smime; root certificates. You can, however, only choose between—in &openpgp; terms—ultimate trust and never trust.

  The backend (by way of &gpgagent;) will ask at root certificate import time whether to trust the imported root certificate. However, that function must be explicitly enabled in the backend configuration (`allow-mark-trusted` in `gpg-agent.conf`, or either GnuPG System GPG Agent Allow clients to mark keys as "trusted" or S/MIME Validation Allow to mark root certificates as trusted under settings-configure-kleopatra).

  Enabling that functionality in the backend can lead to popups from &pinentry; at inopportune times (⪚ when verifying signatures), and can thus block unattended email processing. For that reason, and because it is desirable to be able to distrust a trusted root certificate again, &kleopatra; allows manual setting of trust.

  Due to lack of backend support for this function, &kleopatra; needs to work directly on the &gpgsm; trust database (`trustlist.txt`). When using this function, make sure no other crypto operations are in progress that could race with &kleopatra; for modifications to that database.

  This function is only available when exactly one &smime; root certificate is selected, and that certificate is not yet trusted.

  Use certificates-distrust-root to undo this function.

Certificates Distrust Root Certificate

- Marks this (&smime;) root certificate as not trusted.

  This function is only available when exactly one &smime; root certificate is selected, and that certificate is currently trusted.

  Used to undo certificates-trust-root. See there for details.

Certificates Certify Certificate...

- Allows you to certify another &openpgp; certificate.

  This function is only available if exactly one &openpgp; certificate is selected.

Certificates Change Expire Date...

- Allows to change the expiry date of your &openpgp; certificate.

  Use this function to extend the lifetime of your &openpgp; certificates as an alternative to either creating a new one, or using unlimited lifetime (never expires).

  This function is only available if exactly one &openpgp; certificate is selected, and the secret key is available for that certificate.

Certificates Change Passphrase...

- Allows to change the passphrase of your secret key.

  This function is only available if exactly one certificate is selected, and the secret key is available for that certificate. It requires a very recent backend, since we changed the implementation from direct calling of &gpg; and &gpgsm; to a &gpgme;-based one.

  For security reasons, both the old as well as the new passphrase is asked for by &pinentry;, a separate process. Depending on the platform you are running on and on the quality of the &pinentry; implementation on that platform, it may happen that the &pinentry; window comes up in the background. So, if you select this function and nothing happens, check the operating system's task bar in case a &pinentry; window is open in the background.

Certificates Add User-ID...

- Allows to add a new User-ID to your &openpgp; certificate.

  Use this to add new identities to an existing certificate as an alternative to creating a new key pair. An &openpgp; user-ID has the following form:

      Real Name (Comment) <Email>

  In the dialog that comes up when you select this function, &kleopatra; will ask you for each of the three parameters (`Real Name`, `Comment` and `Email`) separately, and display the result in a preview.

  These parameters are subject to the same Administrator restrictions as in new certificates. See functions-newkey and admin-certificate-request-wizard for details.

  This function is only available when exactly one &openpgp; certificate is selected, and the secret key is available for that certificate.

Del Certificates Delete

- Deletes the selected certificates from the local keyring.

  Use this function to remove unused keys from your local keybox. However, since certificates are typically attached to signed emails, verifying an email might result in the key just removed to pop back into the local keybox. So it is probably best to avoid using this function as much as possible. When you are lost, use the search bar or the view-hierarchical-key-list function to regain control over the lot of certificates.

  There is one exception to the above: When you delete one of your own certificates, you delete the secret key along with it. This implies that you will not be able to read past communication encrypted to you using this certificate, unless you have a backup somewhere.

  &kleopatra; will warn you when you attempt to delete a secret key.

  Due to the hierarchical nature of &smime; certificates, if you delete an &smime; issuer certificate (&ca; certificate), all subjects are deleted, too.

  This is the same as a filesystem: When you delete a folder, you delete all files and folders in it, too.

  Naturally, this function is only available if you selected at least one certificate.

Certificates Dump Certificate

- Shows all information that &gpgsm; has about the selected (&smime;) certificate.

  See the discussion about `--dump-key `key`` in the &gpgsm; manual for details about the output.

### Tools Menu

Ferramentas Visor de Eexistro do GnuPG...

- Starts &kwatchgnupg;, a tool to present the debug output of &gnupg; applications. If signing, encryption, or verification mysteriously stop working, you might find out why by looking at the log.

  This function is not available on Windows, since the underlying mechanisms are not implemented in the backend on that platform.

Tools Refresh OpenPGP Certificates

- Refreshes all &openpgp; certificates by executing

      gpg --refresh-keys

  After successful completion of the command, your local keystore will reflect the latest changes with respect to validity of &openpgp; certificates.

  See note under certificates-refresh-x509 for some caveats.

Tools Refresh X.509 Certificates

- Refreshes all &smime; certificates by executing

      gpgsm -k --with-validation --force-crl-refresh --enable-crl-checks

  After successful completion of the command, your local keystore will reflect the latest changes with respect to validity of &smime; certificates.

  Refreshing &x509; or &openpgp; certificates implies downloading all certificates and &crl;s, to check if any of them have been revoked in the meantime.

  This can put a severe strain on your own as well as other people's network connections, and can take up to an hour or more to complete, depending on your network connection, and the number of certificates to check.

Tools Import CRL From File...

- Lets you manually import &crl;s from files.

  Normally, Certificate Revocation Lists (&crl;s) are handled transparently by the backend, but it can sometimes be useful to import a &crl; manually into the local &crl; cache.

  For &crl; import to work, the &dirmngr; tool must be in the search `PATH`. If this menu item is disabled, you should contact the system administrator and ask them to install &dirmngr;.

### Settings Menu

Settings Perform Self-Test

- Performs a set of self-tests and presents their result.

  This is the same set of tests that is run at startup by default. If you disabled startup-time self-tests, you can re-enable them here.

Settings Toolbars

- Shows/hides &kleopatra; toolbars.

  &kleopatra; has two toolbars:

  1. Main Toolbar

     This toolbar carries a selection of common functions. You can configure which functions you would like to see here using settings-configure-toolbars.

  2. Search Toolbar

     This toolbar carries the search and filtering controls.

Configuración Mostrar a Barra de estado

- Alterna a visibilidade da barra de estado de embaixo.

Configuración Configurar Atallos...

- Abre o diálogo normal de configuración de atallos do &kde;, no que se poden asignar e redistribuir os atallos deteclado de todos os elementos do menú.

Settings Configure Toolbars...

- Opens the standard &kde; toolbar configuration dialog, where you can choose which actions to include in &kleopatra;s toolbars.

Configuración Configurar &kleopatra;...

- Abre o diálogo de configuración do &kleopatra;.

  See configuration for details.

### Window Menu

The Window menu allows you to manage the tabs. Using the items in this menu you can rename a tab, add a new tab, duplicate the current tab, close the current tab, and move the current tab to the left or right.

By clicking with the &RMB; click on a tab you open a context menu, where you can also select the same actions.

### Help Menu

O menú Axuda contén o menú de axuda normal do &kde;.

&help.menu.documentation;

## Referencia das opcións da liña de comandos

Aquí só se listan as opcións específicas do &kleopatra;. Como con todas as aplicacións do &kde;, pódese obter unha listaxe completa de opcións mediante o comando ``kleopatra `--help```.

`--external`

- Run UI server only, hide main window

`-p` `--openpgp`

- Use OpenPGP for the following operation

`-c` `--cms`

- Use CMS (X.509, S/MIME) for the following operation

`-i` `--import-certificate`

- Especifica un ficheiro ou &URL; desde onde importar certificados (ou chaves secretas).

  This is the command line equivalent of file-import-certificates.

`-e` `--encrypt`

- Encrypt file(s)

`-s` `--sign`

- Sign file(s)

`-E` `--encrypt-sign`

- Encrypt and/or sign file(s)

`-d` `--decrypt`

- Decrypt file(s)

`-V` `--verify`

- Verify file/signature

`-D` `--decrypt-verify`

- Decrypt and/or verify file(s)

## Configurar o &kleopatra;

&kleopatra;'s configure dialog can be accessed via settings-configure-kleopatra.

Cada unha das súas páxinas está descrita nas seccións embaixo.

### Configuring Directory Services

On this page, you can configure which &ldap; servers to use for &smime; certificate searches, and which key servers to use for &openpgp; certificate searches.

This is simply a more user-friendly version of the same settings you also find in configuration-gnupg-system. Everything you can configure here, you can configure there, too.

#### A Note On Proxy Settings

Proxy settings can be configured for &http; and &ldap; in configuration-smime-validation, but only for &gpgsm;. For &gpg;, due to the complexity of keyserver options in &gpg; and lack of proper support for them in &gpgconf;, you currently need to modify the config file `gpg.conf` directly. Please refer to the &gpg; manual for details. &kleopatra; will preserve such settings, but does not yet allow to modify them in the &GUI;.

The Directory services table shows which servers are currently configured. Double-click on a cell in the table to change parameters of existing server entries.

The meaning of the columns in the table is as follows:

Scheme

- Determines the network protocol which is used to access the server. Often-used schemes include ldap (and its &ssl;-secured sibling ldaps) for &ldap; servers (common protocol for &smime;; the only one supported by &gpgsm;), and hkp, the Horowitz Keyserver Protocol, nowadays usually &http; Keyserver Protocol, a &http;-based protocol that virtually all public &openpgp; keyservers support.

  Please refer to the &gpg; and &gpgsm; manuals for a list of supported schemes.

Server Name

- The domain name of the server, ⪚ `keys.gnupg.net`.

Server Port

- The network port the server is listening on.

  This changes automatically to the default port when you change the configuration-directory-services-scheme, unless it was set to some non-standard port to begin with. If you changed the default port and cannot get it back, try setting configuration-directory-services-scheme to `http` and configuration-directory-services-server-port to `80` (the default for &http;), then take it from there.

Base DN

- The Base-&dn; (only for &ldap; and &ldaps;), &ie; the root of the &ldap; hierarchy to start from. This is often also called search root or search base.

  It usually looks like `c=de,o=Foo`, given as part of the &ldap; &URL;.

User Name

- The user name, if any, to use for logging into the server.

  This column is only shown if the option Show user and password information (below the table) is checked.

Password

- The password, if any, to use for logging into the server.

  This column is only shown if the option Show user and password information (below the table) is checked.

X.509

- Check this column if this entry should be used for &x509; (&smime;) certificate searches.

  Only &ldap; (and &ldaps;) servers are supported for &smime;.

OpenPGP

- Check this column if this entry should be used for &openpgp; certificate searches.

You can configure as many &smime; (&x509;) servers as you want, but only one &openpgp; server is allowed at any time. The &GUI; will enforce this.

To add a new server, click on the New button. This duplicates the selected entry, if any, or else inserts a default &openpgp; server. Then you can set the configuration-directory-services-server-name, the configuration-directory-services-server-port, the configuration-directory-services-base-dn, and the usual configuration-directory-services-password and configuration-directory-services-user-name, both of which are only needed if the server requires authentication.

To directly insert an entry for &x509; certificates, use New X.509; use New OpenPGP for &openpgp;.

To remove a server from the search list, select it in the list, then press the Delete button.

To set the &ldap; timeout, &ie; the maximum time the backend will wait for a server to respond, simply use the corresponding input field labeled LDAP timeout (minutes:seconds).

Se un dos servidores ten unha base de datos grande, de maneira que mesmo as procuras roazoábeis tipo `García` atinxan o número máximo de elementos devoltos na solicitude, pode que queira aumentar este límite. Pode averiguar facilmente se atinxe o límite durante a procura, dado que entón aparecerá unha mensaxe avisando que se limitaron os resultados.

Algúns servidores poden impoñer os seus propios límites no número de elementos que devolve unha pesquisa. Neste caso, incrementar o límite aquí non resultará en que se devolvan máis elementos.

### Configuring Appearance

#### Configuring Tooltips

In the main certificate list, &kleopatra; can show details about a certificate in a tooltip. The information displayed is the same as in the Overview tab of the Certificate Details dialog. Tooltips, however, can be restricted to show only a subset of information for a less verbose experience.

The Key-ID is always shown. This is to ensure that tooltips for different certificates do, in fact, differ (this is especially important if only tooltips-validity has been selected).

You can independently enable or disable the following information sets:

Show validity

- Shows information about the validity of a certificate: its current status, issuer-&dn; (&smime; only), expiry dates (if any) and certificate usage flags.

  Example:

      This certificate is currently valid.
      Issuer:            CN=Test-ZS 7,O=Intevation GmbH,C=DE
      Validity:          from 25.08.2009 10:42 through 19.10.2010 10:42
      Certificate usage: Signing EMails and Files, Encrypting EMails and Files
      Key-ID:            DC9D9E43

Show owner information

- Shows information about the owner of the certificate: subject-&dn; (&smime; only), user-IDs (including emails addresses) and ownertrust (&openpgp; only).

  &openpgp; example:

      User-ID:           Gpg4winUserA <gpg4winusera@test.hq>
      Key-ID:            C6BF6664
      Ownertrust:        ultimate

  &smime; example:

      Subject:           CN=Gpg4winTestuserA,OU=Testlab,O=Gpg4win Project,C=DE
      a.k.a.:            Gpg4winUserA@test.hq
      Key-ID:            DC9D9E43

Show technical details

- Shows technical information about the certificate: serial number (&smime; only), type, fingerprint and storage location.

  Example:

      Serial Number:     27
      Certificate type:  1,024-bit RSA (secret certificate available)
      Key-ID:            DC9D9E43
      Fingerprint:       854F62EEEBB41BFDD3BE05D124971E09DC9D9E43
      Stored:            on this computer

#### Configuring Certificate Categories

&kleopatra; allows you to customize the appearance of certificates in the list view. This includes showing a small icon, but you can also influence the foreground (text) and background colors, as well as the font.

Each certificate category in the list is assigned a set of colors, an icon (optional) and a font in which certificates from that category are displayed. The category list also acts as a preview of the settings. Categories can be freely defined by the administrator or the power user, see admin-key-filters in admin.

To set or change the icon of a category, select it in the list, and press the Set Icon... button. The standard &kde; icon selection dialog will appear where you can select an existing icon from the &kde; collection, or load a custom one.

To remove an icon again, you need to press the Default Appearance button.

To change the text (&ie; foreground) color of a category, select it in the list, and press the Set Text Color... button. The standard &kde; color selection dialog will appear where you can select an existing color or create a new one.

Changing the background color is done in the same way, just press Set Background Color... instead.

Para modificar a fonte disponse de dúas opcións:

1. Modify the standard font, used for all list views in &kde;.

2. Empregar un tipo de letra personalizado.

A primeria opción ten a vantaxe de que o tipo de letra será o que escolla para todo o &kde;, mentres que a segunda lle dá control completo sobre o tipo de letra que queira usar. A escolla é súa.

Para empregar o tipo de letra normal modificado, escolla a categoría na lista e seleccione ou non os modificadores de fonte Cursiva, Negriña e/ou Riscado. Pode ver inmediatamente o efecto sobre a fonte na lista de categorías.

To use a custom font, press the Set Font... button. The standard &kde; font selection dialog will appear where you can select the new font.

You can still use the font modifiers to change the custom font, just as for modifying the standard font.

To switch back to the standard font, you need to press the Default Appearance button.

#### Configuring DN-Attribute Order

Ainda que as &dn;s son xerárquicas, a orde dos componentes individuais (chamados &dn;s relativas (RDNS) ou atributos &dn;) non está definida. A orde na que se mostran é, polo tanto, cuestión de gosto persoal ou política da empresa, que é polo que se pode configurar no &kleopatra;.

Esta opción non só se aplica ao &kleopatra;, mais tamén a todas as aplicacións que empregan a Tecnoloxía do &kleopatra;. No momento de escribir isto, estes inclúen o &kmail;, o &kaddressbook;, así como o propio &kleopatra;, como é obvio.

Esta páxina de configuración consiste basicamente en dúas listas, unha para os atributos coñecidos (Atributos disponíbeis) e outra que describe a Orde actual dos atributos.

Both lists contain entries described by the short from of the attribute (⪚ CN) as well as the spelled-out form (Common Name).

A lista de Atributos disponíbeis está sempre ordenada alfabeticamente, mentres que a orde da lista de Orde actual dos atributos reflicte a orde configurada de atributos &dn;: o primeiro atributo da lista é tamén o atributo mostrado en primeiro lugar.

Só se mostran de todo os atributos listados explicitamente na lista de Orde actual dos atributos. O resto fica escondido por omisión.

Porén, se a entrada de substitución _X_ (Todos os outros) está na lista actual, todos os atributos non listados (sexan coñecidos ou non), insírense no lugar de _X_, na súa orde relativa orixinal.

Un pequeno exemplo axudará a clarificar isto:

Dado o &dn;

> O=&kde;, C=US, CN=Dave Devel, X-BAR=foo, OU=&kleopatra;, X-FOO=bar,

the default attribute order of CN, L, _X_, OU, O, C will produce the following formatted &dn;:

> CN=Dave Devel, X-BAR=foo, X-FOO=bar, OU=&kleopatra;, O=&kde;, C=US

while CN, L, OU, O, C will produce

> CN=Dave Devel, OU=&kleopatra;, O=&kde;, C=US

Para engadir un atributo á lista da orde de presentación, seleccióneo na lista Atributos disponíbeis e prema o botón Engadir á orde actual dos atributos.

Para eliminar un atributo da lista da orde de presentación, seleccióneo na lista Orde actual dos atributos e prema o botón Eliminar da orde actual dos atributos.

Para mover un atributo para o principio (ou fin), seleccióneo na lista Orde actual dos atributos e prema o botón Mover ao inicio (Mover á fin).

Para subir (ou baixar) só unha posición, seleccióneo na lista Orde actual dos atributos e prema o botón Subir (ou Baixar).

### Configuring Crypto Operations

#### Configuring EMail Operations

Here you can configure some aspects of the email operations of &kleopatra;'s &uiserver;. Currently, you can only configure whether to use Quick Mode for signing and encrypting emails, respectively.

When Quick Mode is enabled, no dialog is shown when signing (encrypting) emails, respectively, unless there is a conflict that needs manual resolution.

#### Configuring File Operations

Here you can configure some aspects of the file operations of &kleopatra;'s &uiserver;. Currently, you can only choose the checksum program to use for `CHECKSUM_CREATE_FILES`.

Use Checksum program to use to choose which of the configured checksum programs should be used when creating checksum files.

When verifying checksums, the program to use is automatically found, based on the names of the checksum files found.

The administrator and power user can completely define which checksum programs to make available to &kleopatra; through so-called Checksum Definitions in the config file. See admin-checksum-definitions in admin for details.

### Configuring aspects of S/MIME Validation

On this page, you can configure certain aspects of the validation of &smime; certificates.

For the most part, this is simply a more user-friendly version of the same settings you also find in configuration-gnupg-system. Everything you can configure here, you can configure there, too, with the exception of configuration-smime-validation-refresh-interval, which is &kleopatra;-specific.

The meaning of the options is as follows:

#### Configuring interval certificate checking

Check certificate validity every `N` hours

- This option enables interval checking of certificate validity. You can also choose the checking interval (in hours). The effect of interval checking is the same as view-redisplay; there is no provision for interval scheduling of certificates-refresh-openpgp or certificates-refresh-x509.

  Validation is performed implicitly whenever significant files in `~/.gnupg` change. This option, just like certificates-refresh-openpgp and certificates-refresh-x509, therefore only affects external factors of certificate validity.

#### Configuring validation method

Validate certificates using CRLs

- If this option is selected, &smime; certificates are validated using Certificate Revocation Lists (&crl;s).

  See configuration-smime-validation-use-ocsp for alternative method of certificate validity checking.

Validate certificates online (OCSP)

- If this option is selected, &smime; certificates are validated online using the Online Certificates Status Protocol (&ocsp;).

  When choosing this method, a request is sent to the server of the &ca; more or less each time you send or receive a cryptographic message, thus theoretically allowing the certificate issuing agency to track whom you exchange (⪚) mails with.

  To use this method, you need to enter the &URL; of the &ocsp; responder into configuration-smime-validation-ocsp-url.

  See configuration-smime-validation-use-ocsp for a more traditional method of certificate validity checking that does not leak information about whom you exchange messages with.

OCSP responder URL

- Enter here the address of the server for online validation of certificates (&ocsp; responder). The &URL; usually starts with `http://`.

OCSP responder signature

- Choose here the certificate with which the &ocsp; server signs its replies.

Ignore service URL of certificates

- Each &smime; certificate usually contains the &URL; of its issuer's &ocsp; responder (certificates-dump-certificate will reveal whether a given certificate contains it).

  Checking this option makes &gpgsm; ignore those &URL;s and only use the one configured above.

  Use this to ⪚ enforce use of a company-wide &ocsp; proxy.

#### Configuring validation options

Do not check certificate policies

- By default, &gpgsm; uses the file `~/.gnupg/policies.txt` to check if a certificate policy is allowed. If this option is selected, policies are not checked.

Never consult a CRL

- If this option is checked, Certificate Revocation Lists are never used to validate &smime; certificates.

Allow to mark root certificates as trusted

- If this option is checked while a root &ca; certificate is being imported, you will be asked to confirm its fingerprint and to state whether or not you consider this root certificate to be trusted.

  A root certificate needs to be trusted before the certificates it certified become trusted, but lightly allowing trusted root certificates into your certificate store will undermine the security of the system.

  Enabling this functionality in the backend can lead to popups from &pinentry; at inopportune times (⪚ when verifying signatures), and can thus block unattended email processing. For that reason, and because it is desirable to be able to distrust a trusted root certificate again, &kleopatra; allows manual setting of trust using certificates-trust-root and certificates-distrust-root.

  This setting here does not influence the &kleopatra; function.

Fetch missing issuer certificates

- If this option is checked, missing issuer certificates are fetched when necessary (this applies to both validation methods, &crl;s and &ocsp;).

#### Configuring &http; request options

Do not perform any HTTP requests

- Entirely disables the use of &http; for &smime;.

Ignore HTTP CRL distribution point of certificates

- When looking for the location of a &crl;, the to-be-tested certificate usually contains what are known as &crl; Distribution Point (DP) entries, which are &URL;s describing the way to access the &crl;. The first-found DP entry is used.

  With this option, all entries using the &http; scheme are ignored when looking for a suitable DP.

Use system HTTP proxy

- If this option is selected, the value of the &http; proxy shown on the right (which comes from the environment variable `http_proxy`) will be used for any &http; request.

Use this proxy for HTTP requests

- If no system proxy is set, or you need to use a different proxy for &gpgsm;, you can enter its location here.

  It will be used for all HTTP requests relating to S/MIME.

  The syntax is ``host``:``port``, ⪚ `myproxy.nowhere.com:3128`.

#### Configuring &ldap; request options

Do not perform any LDAP requests

- Entirely disables the use of &ldap; for &smime;.

Ignore LDAP CRL distribution point of certificates

- When looking for the location of a &crl;, the to-be-tested certificate usually contains what are known as "&crl; Distribution Point" (DP) entries, which are &URL;s describing the way to access the &crl;. The first found DP entry is used.

  With this option, all entries using the &ldap; scheme are ignored when looking for a suitable DP.

Primary host for LDAP requests

- Entering an &ldap; server here will make all &ldap; requests go to that server first. More precisely, this setting overrides any specified `host` and `port` part in an &ldap; &URL; and will also be used if `host` and `port` have been omitted from the &URL;.

  Other &ldap; servers will be used only if the connection to the proxy failed. The syntax is ``host`` or ``host``:``port``. If `port` is omitted, port 389 (standard &ldap; port) is used.

### Configuring the GnuPG System

This part of the dialog is auto-generated from the output of `gpgconf `--list-components`` and, for each `component` that the above command returns, the output of `gpgconf `--list-options` `component``.

The most useful of these options have been duplicated as separate pages in the &kleopatra; config dialog. See configuration-directory-services and configuration-smime-validation for the two dialog pages which contain selected options from this part of the dialog.

The exact content of this part of the dialog depends on the version of the &gnupg; backend you have installed and, potentially, the platform you run on. Thus, we will only discuss the general layout of the dialog, including the mapping from &gpgconf; option to &kleopatra; &GUI; control.

&gpgconf; returns configuration information for multiple components. Inside each component, individual options are combined into groups.

&kleopatra; displays one tab per component reported by &gpgconf;; groups are headed by a horizontal line displaying the group name as returned from &gpgconf;.

Each &gpgconf; option has a type. Except for certain well-known options which &kleopatra; backs with specialised controls for a better user experience, the mapping between &gpgconf; types and &kleopatra; controls is as follows:

### Mapping From &gpgconf; Types To &GUI; Controls

&gpgconf; type | &kleopatra; control
for lists | for non-lists
`none` | Spinbox (count-semantics) | Checkbox
`string` | &NA; | Lineedit
`int32` | Lineedit (unformatted) | Spinbox
`uint32`
`pathname` | &NA; | specialised control
`ldap server` | specialised control | &NA;
`key fingerprint` | &NA;
`pub key`
`sec key`
`alias list`

See the &gpgconf; manual for more information about what you can configure here, and how.

## Guía do Administrador

Esta Guía do Administrador describe as formas de personalizar o &kleopatra; que non están disponíbeis através da interface gráfica, mais só através de ficheiros de configuración.

Asúmese que o lector está familiarizado coa tecnoloxía empregada para a configuración das aplicacións do &kde;, incluído a disposición, localización no sistema de ficheiros e o encadeamento dos ficheiros de configuración do &kde;, así como a infra-estrutura KIOSK.

### Personalización do asistente de creación de certificados

#### Customizing the DN fields

O &kleopatra; permite personalizar os campos nos que pode entrar o usuario para axudar na creación do certificado.

Cree un grupo chamado `CertificateCreationWizard` no ficheiro `kleopatrarc` do sistema. Se quere unha orde personalizada dos atributos, ou se quere que só aparezan certos elementos, cree unha chave chamada `DNAttributeOrder`. O argumento é un de entre `CN,SN,GN,L,T,OU,O,PC,C,SP,DC,BC,EMAIL`. Se quere inicializar os campos cun valor determinado, escriba algo así como Attribute=valor. Se quere que o atributo se trate como requirido, engada un símbolo de admiración (p. ex. `CN!,L,OU,O!,C!,EMAIL!`, que é, de feito, a configuración por omisión).

O uso do modificador de modos de KIOSK `$e` permite recuperar os valores das variábeis de ambiente ou dun guión ou binario avaliados. Se quere ademais desactivar a edición do campo correspondente, empregue o modificador `$i`. Se quere desactivar o uso do botón Inserir o Meu Enderezo, configure `ShowSetWhoAmI` como "false".

Debido á natureza da infra-estrutura KIOSK do &kde;, o uso da bandeira inalterável (`$i`) imposibilita que o usuario ignore a bandeira. Este comportamento é o pretendido. `$i` e `$e` pódense empregar tamén con todas as demais chaves de configuración das aplicacións do &kde;.

O exemplo seguinte esquematiza as personalizacións posíbeis:

    [CertificateCreationWizard]
    ;Disallow to copy personal data from the addressbook, do not allow local override
    ShowSetWhoAmI[$i]=false

    ;sets the user name to $USER
    CN[$e]=$USER

    ;sets the company name to "My Company", disallows editing
    O[$i]=My Company

    ;sets the department name to a value returned by a script
    OU[$ei]=$(lookup_dept_from_ip)

    ; sets country to DE, but allows for changes by the user
    C=DE

#### Restricting the Types of Keys a User is Allowed to Create

&kleopatra; also allows to restrict which type of certificates a user is allowed to create. Note, however, that an easy way around these restrictions is to just create one on the command line.

##### Public Key Algorithms

To restrict the public key algorithm to use, add the config key `PGPKeyType` (and `CMSKeyType`, but only RSA is supported for CMS anyway) to the `CertificateCreationWizard` section of `kleopatrarc`.

The allowed values as `RSA` for RSA keys, `DAS` for DSA (sign-only) keys, and `DSA+ELG` for a DSA (sign-only) key with an Elgamal subkey for encryption.

The default is read from &gpgconf; or else `RSA` if &gpgconf; doesn't provide a default.

##### Public Key Size

To restrict the available keys sizes for a public algorithm, add the config key ``<ALG>`KeySizes` (where `ALG` may be `RSA`, `DSA` or `ELG`) to the `CertificateCreationWizard` section of `kleopatrarc`, containing a comma-separated list of keysizes (in bits). A default may be indicated by prefixing the keysize with a hyphen (`-`).

    RSAKeySizes = 1536,-2048,3072

The above would restrict allowed RSA key sizes to 1536, 2048 and 3072, with 2048 the default.

In addition to the sizes themselves, you may also specify labels for each of the sizes. Simply set the config key ``ALG`KeySizeLabels` to a comma-separated list of labels.

    RSAKeySizeLabels = weak,normal,strong

The above, in connection with the previous example, would print something like the following options for selection:

    weak (1536 bits)
                  normal (2048 bits)
                  strong (3072 bits)

The defaults are as if the following was in effect:

    RSAKeySizes = 1536,-2048,3072,4096
                  RSAKeySizeLabels =
                  DSAKeySizes = -1024,2048
                  DSAKeySizeLabels = v1,v2
                  ELGKeySizes = 1536,-2048,3072,4096

### Crear e modificar categorías de chaves

&kleopatra; allows the user to configure the visual appearance of keys based on a concept called Key Categories. Key Categories are also used to filter the list of certificates. This section describes how you can edit the available categories and add new ones.

Ao tentar atopar a categoría á que pertence unha chave, o &kleopatra; tenta que a chave corresponda cunha secuencia de filtros de chaves configurada en `libkleopatrarc`. A primeira que coincida define a categoría, baseada nun concepto de especificidade, que se explica máis abaixo.

Cada filtro de chaves está definido nun grupo de configuración que se chama `Key Filter #`n``, no que `n` é un número que comeza en `0`.

The only mandatory keys in a `Key Filter #`n`` group are `Name`, containing the name of the category as displayed in the config dialog, and `id`, which is used as a reference for the filter in other configuration sections (such as `View #`n``).

table-key-filters-appearance lists all keys that define the display properties of keys belonging to that category (&ie; those keys that can be adjusted in the config dialog), whereas table-key-filters-criteria lists all keys that define the criteria the filter matches keys against.

### Chaves de configuración do filtro de chaves que definen propiedades de configuración

Chave de configuración | Tipo | Descrición
`cor de fondo` | cor | A cor de fondo a usar. Se faltar, usa a cor de fondo definida a nivel global para as listas.
`cor do primeiro plano` | cor | A cor do texto a usar. Se faltar, usa a cor do texto definida a nivel global para as listas.
`font` | fonte | O tipo de letra a usar. Esta fonte axustaráse ao tamaño configurado para as vistas de lista e aplicaránselle todos os atributos de fonte (ver máis abaixo).
`font-bold` | lóxico | Se é `true` e `font` non está definida, emprega a fonte por omisión das listas co estilo negriña engadido (de estar disponíbel). Ignórase se `font` estiver tamén presente.
`font-italic` | lóxico | Semellante a `font-bold`, mais para o estilo de fonte cursiva no canto de negriña.
`font-strikeout` | lóxico | Se é `true`, debuxa unha liña centrada por riba da fonte. Aplícase mesmo cando `font` tamén estea definida.
`icon` | text | O nome da icona para mostrar na primeira columna. Ainda non funciona.

### Chaves de configuración do filtro de chaves que definen criterios de filtrado

Chave de configuración | Tipo | Se están especificadas, o filtro coincide cando...
`is-revoked` | lóxico | a chave foi revogada.
`match-context` | context Context is an enumeration with the following allowed values: `appearance`, `filtering` and `any`. | the context in which this filter matches.
`is-expired` | lóxico | a chave caducou.
`is-disabled` | lóxico | a chave foi desactivada (marcada para que non se utilice) polo usuasrio. Ignórase para as chaves &smime;.
`is-root-certificate` | lóxico | a chave é un certificado raiz. Ignórase para as chaves OpenPGP.
`can-encrypt` | lóxico | a chave pode ser utilizada para cifrar.
`can-sign` | lóxico | a chave pode ser utilizada para asinar.
`can-certify` | lóxico | a chave pode ser utilizada para asinar (certificar) outras chaves.
`can-authenticate` | lóxico | a chave pode ser utilizada para autenticar (⪚ como certificado de cliente TLS).
`is-qualified` | lóxico | the key can be used to make Qualified Signatures (as defined by the German Digital Signature Law).
`is-cardkey` | lóxico | the key material is stored on a smartcard (instead of on the computer).
`has-secret-key` | lóxico | a chave secreta deste par da chaves está disponíbel.
`is-openpgp-key` | lóxico | a chave é unha chave OpenPGP (`true`), ou unha chave &smime; (`false`).
`was-validated` | lóxico | the key has been validated.
``prefix`-ownertrust` | validez A validez é unha enumeración (ordenada) cos valores adicionais seguintes: `unknown` (descoñecida), `undefined` (sen definir), `never` (nunca), `marginal` (marxinal), `full` (completa), `ultimate` (definitiva). Vexa os manuais do &gpg; e o &gpgsm; para unha explicación detallada | a chave ten exactamente (`prefixo` = `is`), ten calquer cousa excepto (`prefixo` = `is-not`), ten polo menos (`prefixo` = `is-at-least`) ou ten como máximo (`prefixo` = `is-at-most`) o grao de confianza dado como valor da chave de configuración. Non está definido o comportamento se nun mesmo grupo están presentes máis chaves de entre ``prefixo`-ownertrust` (con valores `prefixo`.
``prefixo`-validity` | validez | Semellante a ``prefixo`-ownertrust`, mais para a validez da chave no canto do grao de confianza do dono.

Alguns dos criterios máis interesantes, como `is-revoked` ou `is-expired` só funcionarán coas chaves validadas, que é polo que só se comproban as chaves validades a nivel de revogación e caducidade, ainda que vostede sexa libre de eliminar estas comprobacións extra.

Para alén das chaves de configuración indicadas arriba, un filtro de chaves pode ter tamén un `id` e un `match-contexts`.

Usando o `id` do filtro, que por omisión é o nome do grupo da configuración do filtro se non é baleiro, pode referenciar o filtro de chaves noutro lugar da configuración, ⪚ nas configuracións de Vista do &kleopatra;. &kleopatra; non interpreta `id`, así que pode empregar calquer cadea que queira, con só que sexa única.

`match-contexts` limita a aplicabilidade do filtro. Actualmente defínense dous contextos: O contexto `appearance` emprégase ao definir as propiedades de cor de tipo de letra das vistas. O contexto `filtering` emprégase para incluir (e excluir) certificados selectivamente das vistas. Pódese empregar `any` para significar todos os contextos definidos nese momento e é o predefinido se non se fornece `match-contexts`, ou se non non produce contextos. Isto garante que ningún filtro de chaves pode terminar morto, &ie; sen contextos sobre os que se aplicar.

The format of the entry is a list of tokens, separated by non-word characters. Each of the tokens is optionally prefixed by an exclamation point (`!`), indicating negation. The tokens act in order on an internal list of contexts, which starts out empty. This is best explained by an example: `any !appearance` is the same as `filtering`, and `appearance !appearance` is producing the empty set, as is `!any`. However, the last two will be internally replaced by `any`, since they produce no contexts at all.

En xeral, os criterios non especificados (&ie; non se define a entrada de configuración) non se verifican. Se se fornece un criterio, compróbase e debe coincidir para que o filtro como un todo coincida, &ie; os criterios agrúpanse cun E lóxico.

Each filter has an implied specificity that is used to rank all matching filters. The more specific filter wins over less specific ones. If two filters have the same specificity, the one that comes first in the config file wins. A filter's specificity is proportional to the number of criteria it contains.

#### Exemplos de filtros de chaves

Para verificar todos os certificados raiz caducados mais non revogados, emprégase un filtro de chaves que se define da seguinte forma:

    [Key Filter #n]
    Name=caducada mais non revogada
    was-validated=true
    is-expired=true
    is-revoked=false
    is-root-certificate=true
    ; ( specificity 4 )

Para verificar todas as chaves OpenPGP desactivadas (ainda non posíbel en &kleopatra;) cun grao de confianza polo menos marxinal, emprégase:

    [Key Filter #n]
    Name=chaves de OpenPGP desactivadas con confianza marxinal ou boa
    is-openpgp=true
    is-disabled=true
    is-at-least-ownertrust=marginal
    ; ( specificity 3 )

### Configuring Archivers for Use with Sign/Encrypt Files

&kleopatra; allows the administrator (and power-user) to configure the list of archivers that are presented in the Sign/Encrypt Files dialog.

Each archiver is defined in `libkleopatrarc` as a separate `Archive Definition #`n`` group, with the following mandatory keys:

`extensions`

- A comma-separated list of filename extensions that usually indicate this archive format.

`id`

- A unique ID used to identify this archiver internally. If in doubt, use the name of the command.

`Name` (translated)

- The user-visible name of this archiver, as shown in the corresponding drop-down menu of the Sign/Encrypt Files dialog.

`pack-command`

- The actual command to archive files. You can use any command, as long as no shell is required to execute it. The program file is looked up using the `PATH` environment variable, unless you use an absolute file path. Quoting is supported as if a shell was used:

      pack-command="/opt/ZIP v2.32/bin/zip" -r -

Since backslash (`\`) is an escape character in KDE config files, you need to double them when they appear in path names:

    pack-command=C:\\Programs\\GNU\\tar\\gtar.exe ...

However, for the command itself (as opposed to its arguments), you may just use forward slashes (`/`) as path separators on all platforms:

    pack-command=C:/Programs/GNU/tar/gtar.exe ...

This is not supported in arguments, as most Windows programs use the forward slash for options. For example, the following will not work, since `C:/myarchivescript.bat` is an argument to `cmd.exe`, and `/` is not converted to `\` in arguments, only commands:

    pack-command=cmd.exe C:/myarchivescript.bat

This needs, instead, to be written as:

    pack-command=cmd.exe C:\\myarchivescript.bat

#### Input Filename Passing for `pack-command`

There are three ways to pass filenames to the pack command. For each of these, `pack-command` provides a particular syntax:

1. As command-line arguments.

   Example (tar):

       pack-command=tar cf -

   Example (zip):

       pack-command=zip -r - %f

   In this case, filenames are passed on the command line, just like you would when using the command prompt. &kleopatra; does not use a shell to execute the command. Therefore, this is a safe way of passing filenames, but it might run into command line length restrictions on some platforms. A literal `%f`, if present, is replaced by the names of the files to archive. Otherwise, filenames are appended to the command line. Thus, the zip Example above could equivalently be written like this:

       pack-command=zip -r -

2. Via standard-in, separated by newlines: prepend `|`.

   Example (GNU-tar):

       pack-command=|gtar cf - -T-

   Example (ZIP):

       pack-command=|zip -@ -

   In this case, filenames are passed to the archiver on stdin, one per line. This avoids problems on platforms which place a low limit on the number of command line arguments that are allowed, but fails when filenames, in fact, contain newlines.

   &kleopatra; currently only supports LF as a newline separator, not CRLF. This might change in future versions, based on user feedback.

3. Via standard-in, separated by NUL-bytes: prepend `0|`.

   Example (GNU-tar):

       pack-command=0|gtar cf - -T- --null

   This is the same as above, except that NUL bytes are used to separate filenames. Since NUL bytes are forbidden in filenames, this is the most robust way of passing filenames, but not all archivers support it.

### Configuring Checksum Programs for Use with Create/Verify Checksums

&kleopatra; allows the administrator (and power-user) to configure the list of checksum programs that the user can choose from in the config dialog and that &kleopatra; is able to auto-detect when asked to verify a given file's checksum.

To be usable by &kleopatra;, output of checksum programs (both the written checksum file, as well as the output on stdout when verifying checksums) needs to be compatible with GNU `md5sum` and `sha1sum`.

Specifically, the checksum file needs to be line-based with each line having the following format:

    CHECKSUM ' ' ( ' ' | '*' ) FILENAME

where `CHECKSUM` consists of hex-characters only. If `FILENAME` contains a newline character, the line must instead read:

    \CHECKSUM ' ' ( ' ' | '*' ) ESCAPED-FILENAME

where `ESCAPED-FILENAME` is the filename with newlines replaced by `\n`s, and backslashes doubled (`\`↦`\\`).

Similarly, the output of checksum-definition-verify-command must be of the form

    FILENAME ( ': OK' | ': FAILED' )

separated by newlines. Newlines and other characters are not escaped in the output.

Yes, these programs were not written with graphical frontends in mind, and &kleopatra; will fail to correctly parse pathological filenames that contain ": OK" plus newline in them.

Each checksum program is defined in `libkleopatrarc` as a separate `Checksum Definition #`n`` group, with the following mandatory keys:

`file-patterns`

- A list of regular expressions that describe which files should be considered checksum files for this checksum program. The syntax is the one used for string lists in KDE config files.

  Since regular expressions usually contain backslashes, care must be taken to properly escape them in the config file. The use of a config file editing tool is recommended.

  The platform defines whether the patterns are treated case-sensitive or case-insensitive.

`output-file`

- The typical output filename for this checksum program (should match one of the checksum-definition-file-patterns, of course). This is what &kleopatra; will use as the output filename when creating checksum files of this type.

`id`

- A unique ID used to identify this checksum program internally. If in doubt, use the name of the command.

`Name` (translated)

- The user-visible name of this checksum program, as shown in the drop-down menu in &kleopatra;'s config dialog.

`create-command`

- The actual command with which to create checksum files. The syntax, restrictions and argument passing options are the same as described for archive-definition-pack-command in admin-archive-definitions.

`verify-command`

- Same as checksum-definition-create-command, but for checksum verification.

Here is a complete example:

    [Checksum Definition #1]
              file-patterns=sha1sum.txt
              output-file=sha1sum.txt
              id=sha1sum-gnu
              Name=sha1sum (GNU)
              Name[de]=sha1sum (GNU)
              ...
              create-command=sha1sum -- %f
              verify-command=sha1sum -c -- %f

## Créditos e Licenza

&kleopatra; copyright 2002 &Steffen.Hansen;, &Matthias.Kalle.Dalheimer; and &Jesper.Pedersen;., copyright 2004 &Daniel.Molkentin;, copyright 2004, 2007, 2008, 2009, 2010 Klarälvdalens Datakonsult AB

Documentation copyright 2002 &Steffen.Hansen;, copyright 2004 &Daniel.Molkentin;, copyright 2004, 2010 Klarälvdalens Datakonsult AB

## Colaboradores

- &Marc.Mutz; &Marc.Mutz.mail;

- &David.Faure; &David.Faure.mail;

- &Steffen.Hansen; hansen@kde.org

- &Matthias.Kalle.Dalheimer; &Matthias.Kalle.Dalheimer.mail;

- &Jesper.Pedersen; &Jesper.Pedersen.mail;

- &Daniel.Molkentin; &Daniel.Molkentin.mail;

Tradución da documentación: Xosé Calvo - http://trasno.net/

&underFDL; &underGPL;
&documentation.index;