PDF Security

A PDF can be secured with several types of passwords. The contents of a secured PDF are encrypted and can be visualized and changed only if the correct password is entered. PDF security settings also include a set of permissions that are applied when a PDF has restricted access.

PDFs support two passwords as follows:

If the PDFs open password field is empty, it is opened in restricted mode without requesting a password. If the full access password field is empty, the PDF open password provides full access.

PDF permissions consist of three sets of actions: printing, changing PDF contents, and extraction of text and other data. These permissions are applicable if a separate full access password is available and the PDF is opened in restricted mode.

PDF security settings include an option to disable encryption of the PDF metadata. Leaving the metadata unencrypted allows you to find the PDF by certain search engines based on the metadata contents without the needing to know the PDFs passwords.

The Protect dialog also allows you to select the encryption algorithm and key size out of the standard options supported by the PDF format.

Working with Digital Signatures

Digital signatures provide additional protection functions that are aimed to ensure the integrity and timeliness of the PDF. The physical content of the PDF that is signed cannot be changed without invalidating the signature. If signature permissions allow, a signed PDF can still be modified using an incremental update, but these modifications are clearly identifiable and the original PDF content can always be restored. PDFs signing in this way represent PDF revisions. The PDF may contain multiple consecutive revisions each protected by its own signature.

In addition to integrity protection, it is also possible to determine if certain PDF revisions existed before a specified time. This is done by embedding a digital timestamp in the PDF; a special type of digital signature created by a trusted timestamp authority accessible through the network.

Validation of digital signatures and adding new signatures to a PDF requires access to the corresponding certificates and private keys which should be located on the mobile device. On Android the certificates and private keys are stored in the special Trusted Credential Storage. Android version 4.0 or later performs signatures validation and addition those done by OfficeSuite's PDF Viewer.

Displaying and Validating Digital Signatures

The Signatures dialog displays all available signatures in the order they are added in the PDF (the oldest at the top of the dialog). The signatures are presented with their most important attributes (type, status, signer, signing time, etc.). Each signature item has an overflow menu that allows you to see the signature details, open the PDF revision related to the signature or go to the corresponding signature field in the PDF if it is visible. If you choose to display a PDF revision related to a signature, the OfficeSuite PDF Viewer opens it in read-only mode with limited functions available. It does, however, allow you to save the revision as a new PDF file which can be later on opened in read-write mode with all functions enabled.

Embedded digital signatures are not validated by default as validation may take significant time. The validation may be started by pressing the Validate button in the Signatures dialog. Signature validation is a comprehensive procedure based on the standards and recommendations of IETF and ETSI. It includes the following validation steps for each signature:

  1. Validate the signing digest including decoding the digest with the signing certificate public key, calculating a new digest from the signed content and comparing the decoded and the newly derived digests.
  2. Validate the signing certificate (see details below).
  3. Validate the embedded timestamp (if any) including steps 1 and 2 for the timestamp digest and the timestamp certificate.
  4. Validate the modifications of the PDF after it was signed to ensure that they are allowed by the signature permissions.

The Signatures Details dialog displays the detailed information for the signature and the results of the above validation steps if the validation was performed.

Signing Certificate Validation

The validation of the signing certificate is the most complicated part of the signature validation process. Certificates are usually issued by Certificate Authorities and are signed with the CA private key. In order to validate the certificate signature, it is necessary to have the certificate of the CA. Often the CA is an intermediate authority and its certificate is also signed by another CA. Thus, it is necessary to build the complete certificate chain up to the root CA which has a self-signed certificate. The signing certificate including the public key is embedded in the signature data in the PDF. However, the CA certificates may or may not be available in the signature data. If the CA certificates are not available in the PDF they should be present in the Android Trusted Credential Storage (TCS). The root certificate should always be found in TCS (even if it is available in the PDF) in order to ensure that the whole chain can be trusted. Android has pre-installed many CA certificates in TCS which belong to global security providers. These certificates are trusted by default. You are allowed to add new CA certificates to TCS, but you should do this only for certificates that you really trust. It is also possible to deny some of the pre-installed CA certificates if you do not trust them (see Android help for details).

When the certificate chain is built each certificate in the chain is validated based on its attributes. The validation includes checking of certificate purpose, time validity, extensions, constraints, etc. In addition, a special check is performed of the certificate revocation status. The Certificate Authority that issued the certificate may revoke it if the certificate private key is compromised for some reason. The CAs provide the so-called Certificate Revocation Lists (CRL) or other online interfaces to check for revoked certificates. The revocation verification information may be embedded in the signature data. If it is not available or it is expired the revocation check needs to be performed online. Therefore, in general, the mobile device must have an Internet connection in order to accomplish the revocation check.

The certificate details as well as the results of the certificate validation are displayed in the Certificate Details dialog. This dialog is opened if you follow the links from the certificate chain displayed in the Signatures Details dialog. The dialog contains a Trust button which is enabled if the certificate belongs to a CA. This button allows you to add certificates extracted from the signature data in the PDF to the Trusted Credential Storage. In particular this function can be used to add the certificate chain root to TCS if it is not there but you trust it. This would be necessary to complete the signature validation without errors.

Time Validation of Digital Signatures

Some elements of the digital signatures (e.g. the certificates and the certificates revocation verification information) are valid within a specified time range. Therefore, the validity of the whole digital signature depends on the moment of time for which the validity is checked. The OfficeSuite PDF Viewer follows the ETSI recommendations for determining the validity check time. In general, the validation of the signatures is made related to the current time. In this case the certificates verification information stored in the PDF is irrelevant and fresh verification information is obtained from the certificate issuer.

However, if the PDF contains timestamp signatures or timestamps embedded in other types of signatures, these timestamps provide secure time anchors which allow the PDF Viewer to perform the validation earlier. In this case the PDF Viewer tries to use the verification information stored in the PDF in case it is protected by a timestamp. In more detail, the validation procedure is as follows:

  1. The "latest" PDF timestamp and all later signatures are validated at the current time with verification information collected at the current time. If the PDF does not contain timestamps all signatures are validated at the current time.
  2. The "inner" PDF signatures (including "inner" timestamps) are validated at the time of the previous valid PDF timestamp that encompasses the necessary verification information. If the verification information is not available or is invalid the validation is done at the current time as described above.

PDF timestamps protect the elements with restricted time validity from expiration. In order to provide such protection a particular timestamp should also be valid. The Certificate Details dialog informs you if the corresponding certificate has the necessary verification information stored in the PDF and is protected by a valid timestamp. Protection of the time-dependent signature elements with timestamps allows long-term validity of the PDF digital signatures.

Managing Signature Profiles

Creating and adding new digital signatures to a PDF requires setting of several parameters including selecting a client certificate with a private key, setting permissions, providing a timestamp server URL, etc. Often the same parameters are used when creating multiple signatures. In order to make the signing faster and simpler the OfficeSuite PDF Viewer allows you to create in advance signature profiles with the most frequently used combinations of parameters. A signature profile may be then applied to create a new signature without needing to enter all parameters.

The Signature Profiles dialog is opened by the Profiles item of the Protect menu. The dialog lists the available profiles grouped by signature type ("Certify", "Sign" and "Timestamp") and allows you to edit, copy, rename or delete existing profiles as well as add new profiles of the corresponding type. The profiles are uniquely identified by type and name. The parameters of the profiles from the different types match the parameters available when adding a signature from the corresponding type (excluding the parameters that are dependent on the particular PDF and may not be predefined in a profile).

Adding Signatures to a PDF

The OfficeSuite PDF Viewer provides three items in the Protect menu (CertifySign and Timestamp) to add the corresponding signature type to the current PDF. When any of these items is selected a dialog is opened which allows you to select a pre-defined signature profile of the selected type. Press the Show details button to see the detailed parameter values and change them if necessary.

The detailed parameters for the different signature type are described below. Not all parameters are available for each signature type.

Ensure Long-term Validity of the Digital Signatures

As described in the Time validation of digital signatures section certain elements of a digital signature have restricted time validity. If they expire the whole signature will be invalidated. To avoid this, all necessary verification information should be included in the signature data and it should be protected by a timestamp. The following actions should be accomplished when adding a new signature:

  1. The complete chain of the signing certificate should be added to the PDF. This is done automatically by the OfficeSuite PDF Viewer.
  2. The certificate revocation verification information for all certificates should be added to the PDF. In order to do this you should check the Add verification info parameter. Note that this action can increase significantly the signature data and the signed PDF respectively.
  3. Add an embedded timestamp to the signature or a separate timestamp signature immediately after the signing.

The above procedure ensures the validity of the added signature until the protective timestamp is valid.

Adding Certificates and Private Keys to the Trusted Credential Storage

The Trusted Credential Storage (TCS) is an Android secure store for CA certificates and client certificates with private keys. The options for TCS management can be found in the Android Security Settings under the Credential Storage heading (the exact location and option names may vary depending on the Android version). The Trusted Credential Storage contains many pre-installed certificates which belong to global security providers. The new certificates are installed using the Install from internal storage option. When this option is selected a file browser window is opened which allows you to choose the files containing the certificates to be installed. (Some Android versions may require that the files are located in the root of the device internal storage or external SD card.) The following types of certificates can be added to TCS:

The installed CA certificates can be reviewed using the Trusted credentials option of the Android Security Settings. Note that the client certificates are not shown in the Trusted Credentials view. However if the installation is successful they will be available in the corresponding signature dialogs of the OfficeSuite PDF Viewer.

Note: When you try to add a new certificate to the Trusted Credential Storage the Android system may ask you to set a secure screen lock (e.g. pattern, PIN or password) if such a lock is not already set. This is necessary to ensure that your certificates have enough protection if your device is lost or physically accessed without your permission.

Troubleshooting the Digital Signatures Handling

Validation of the digital signatures and addition of new signatures involve complicated procedures which may fail due to different reasons. If you experience errors during signature validation or addition, please make sure that the following conditions are met: