SecureBlackbox 2020 Kotlin Edition

Questions / Feedback?

PDFVerifier Component

Properties   Methods   Events   Configuration Settings   Errors  

The PDFVerifier component verifies signatures over PDF documents.

Syntax

secureblackbox.Pdfverifier

Remarks

Use PDFVerifier to validate electronic signatures over PDF documents. Generic and PAdES signatures are supported.

PDFVerifier validates each signature from two perspectives: the integrity and validity of the signature itself (i.e. its correspondence to the document data it covers), and the validity and trustworthiness of the signing certificate chain. These two signature aspects are generally independent of each other: the signature may be valid but the chain may not be trusted, or, the other way round, the chain may be trusted, but the integrity of the signature may be violated. Under normal circumstances both the signature and the chain must be valid for the signature to be considered good.

To initiate the validation, assign the path to the signed PDF file to the InputFile property (alternatively, you can provide it in a memory buffer via InputBytes property), and call Verify method. For every signature located in the document, PDFVerifier will fire the SignatureFound event. This event lets you specify whether you want PDFVerifier to validate the signature, the chain, or both.

Note: it does not mean that any of the two is optional. This API lets you be flexible in how you validate documents in your code in accordance with the specifics of your application and its usage scenarios. For example, if your trust environment relies on certificate pinning, validating the chain by PDFVerifier internally may cause unnecessary burden on the system, in which case it may be reasonable to disable it in the event handler.

Once SignatureFound returns, PDFVerifier proceeds to the signature validation routine in accordance with the provided settings. Upon completion of the validation, SignatureValidated event is fired, and the validation results are separately provided via SignatureValidationResult and ChainValidationResult properties. Other information about the signature can be accessed via the Signature property.

PDF format uses incremental updates to introduce changes to the document. This implies that a signature may cover not the whole document but, rather, a certain revision of it. Strictly speaking, every signature in a PDF document apart from, perhaps, the last one covers just some part of the document. In most cases that part matches the revision of the document that existed before all the subsequent signatures had been added.

Because of this specifics of PDF format it is crucially important to understand what part of the document is covered by a specific signature. Use the CoverageEndsAt to establish the scope of a signature. The revision of the document covered by that specific signature ranges from byte 0 to CoverageEndsAt. Alternatively, you can use the GetSignedVersion method to extract the signed revision to a file.

Useful settings and properties

The following properties of PDFVerifier may be handy when working with this component:

  • OfflineMode lets you validate the document without contacting online revocation sources. Paired with switched off system trust settings, it can be used to establish the long-term validity of the document and the completeness of validation material included in it.
  • RevocationCheck lets you adjust the revocation checking preferences.
  • ValidatedSigningTime returns the signing time as recorded in the embedded signature timestamp. This is in contrast to ClaimedSigningTime, which returns the signing time as specified by the signer.
  • ValidationLog is a great way to find out the details of chain validation failures. This property returns a comprehensive validation log that reports all the issues encountered during the validation.
  • If the document is encrypted (in addition to being signed), DecryptionInfoNeeded event will fire, asking you for the decryption certificate or password.

By default, PDFVerifier uses the system trust settings to establish certificate chain validity. You can configure it to use your own, custom validation environment by providing the necessary trust elements via KnownCertificates, TrustedCertificates, KnownCRLs, and other similar properties.

Property List


The following is the full list of the properties of the component with short descriptions. Click on the links for further details.

AllSignaturesValidThe cumulative validity of all signatures.
BlockedCertificatesThe certificates that must be rejected as trust anchors.
CertificatesA collection of certificates included in the electronic signature.
ChainValidationDetailsThe details of a certificate chain validation outcome.
ChainValidationResultThe general outcome of a certificate chain validation routine. Use ChainValidationDetails to get information about the reasons that contributed to the validation result.
ClaimedSigningTimeReturns a signature's claimed signing time.
CRLsA collection of certificate revocation lists embedded into the signature by the signer.
DecryptionCertificateA decryption certificate.
DecryptionCertificatesA collection of decryption certificates.
EncryptedIndicates if the PDF document is encrypted.
EncryptionAlgorithmThe symmetric algorithm used to encrypt the document.
EncryptionTypeThe document encryption type.
IgnoreChainValidationErrorsMakes the component tolerant to chain validation errors.
InputBytesUse this property to pass the input to component in the byte array form.
InputFileA path to the signed PDF file.
InputStreamA stream containing the PDF document to be verified.
KnownCertificatesAdditional certificates for chain validation.
KnownCRLsAdditional CRLs for chain validation.
KnownOCSPsAdditional OCSP responses for chain validation.
MetadataEncryptedIndicates if the document metadata is encrypted.
OCSPsA collection of OCSP responses embedded into the signature.
OfflineModeSwitches the component to the offline mode.
PasswordThe decryption password.
PermissionsContains the document permissions associated with the encryption.
ProfileSpecifies a pre-defined profile to apply when creating the signature.
ProxyThe proxy server settings.
QualifiedIndicates a qualified electronic signature.
RevocationCheckSpecifies the kind(s) of revocation check to perform.
SignatureContains the details of the signature that is currently being validated.
SignaturesProvides details of all signatures found in the PDF document.
SignatureValidationResultThe signature validation result.
SigningCertificateThe certificate of the signature creator.
SocketSettingsManages network connection settings.
TimestampContains the timestamp which is being validated.
TimestampedIndicates whether or not the signature is timestamped.
TLSClientChainThe TLS client certificate chain.
TLSServerChainThe TLS server's certificate chain.
TLSSettingsManages TLS layer settings.
TrustedCertificatesA list of trusted certificates for chain validation.
TSACertificateThe certificate of the Time Stamping Authority.
ValidatedSigningTimeContains the certified signing time.
ValidationLogContains the complete log of the certificate validation routine.
ValidationMomentThe time point at which signature validity is to be established.

Method List


The following is the full list of the methods of the component with short descriptions. Click on the links for further details.

ConfigSets or retrieves a configuration setting.
GetSignedVersionReturns the part of the document that is covered by the signature.
VerifyVerifies a signed PDF document.

Event List


The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.

ChainValidatedReports the completion of a certificate chain validation.
DecryptionInfoNeededRequests decryption information during decryption, signing, or validation.
ErrorInformation about errors during signing/validation.
NotificationThis event notifies the application about an underlying control flow event.
RecipientFoundProvides recipient certificate details to the application.
SignatureFoundSignifies the start of signature validation.
SignatureValidatedMarks the completion of the signature validation routine.
TimestampFoundSignifies the start of a timestamp validation routine.
TimestampValidatedReports the completion of the timestamp validation routine.
TLSCertValidateThis event is fired upon receipt of the TLS server's certificate, allowing the user to control its acceptance.

Configuration Settings


The following is a list of configuration settings for the component with short descriptions. Click on the links for further details.

CustomTSLsSpecifies the custom TSLs.
EmptySignatureFieldAddRevInfo[Index]Specifies if revocation checking should be performed.
EmptySignatureFieldAlternateName[Index]Contains an alternate field name.
EmptySignatureFieldCountThe number of empty signature form fields.
EmptySignatureFieldFlags[Index]The field flags of the signature form field.
EmptySignatureFieldHeight[Index]The Height of the empty signature form field.
EmptySignatureFieldInvisible[Index]The visibility status of the field.
EmptySignatureFieldLegalAttestations[Index]Specifies the legal attestations that are associated with the signature.
EmptySignatureFieldMappingName[Index]The mapping name to be used when exporting form field data from the document.
EmptySignatureFieldName[Index]Textual field name.
EmptySignatureFieldOffsetX[Index]The field's offset from the left page border.
EmptySignatureFieldOffsetY[Index]The field's offset from the bottom page border.
EmptySignatureFieldPage[Index]The index of the form field's page in the document.
EmptySignatureFieldRequiredAllowedChanges[Index]Specifies the changes allowed by the signature.
EmptySignatureFieldRequiredConstraints[Index]Specifies the required Seed Value Dictionary (SVD) constraints.
EmptySignatureFieldRequiredDigestAlgorithms[Index]Specifies the required digest algorithms.
EmptySignatureFieldRequiredFilter[Index]Specifies the required filter.
EmptySignatureFieldRequiredLockAction[Index]Indicates which set of fields shall be locked.
EmptySignatureFieldRequiredLockFields[Index]Indicates the fields that shall be locked on signing.
EmptySignatureFieldRequiredReasons[Index]Specifies the required reasons.
EmptySignatureFieldRequiredSubfilters[Index]Specifies the required subfilters.
EmptySignatureFieldTimestampRequired[Index]Specifies if the signature should be time-stamped.
EmptySignatureFieldTSPURL[Index]URL for a TSP server.
EmptySignatureFieldWidth[Index]The Width of the empty signature form field.
EncryptionHandlerNameSpecifies the custom security handler PDF-name.
ForceCompleteChainValidationWhether to check issuer (CA) certificates when the signing certificate is invalid.
ForceCompleteChainValidationForTrustedWhether to continue with the full validation up to the root CA certificate for mid-level trust anchors.
GracePeriodSpecifies a grace period to apply during revocation information checks.
HardenedKeyGenerationSpecifies if hardened Key generation should be used.
IgnoreOCSPNoCheckExtensionWhether OCSP NoCheck extension should be ignored.
IgnoreSystemTrustWhether trusted Windows Certificate Stores should be treated as trusted.
ImplicitlyTrustSelfSignedCertificatesWhether to trust self-signed certificates.
PageInfoCountThe number of pages.
PageInfoCropBoxEmpty[Index]Check if the page's crop box is empty or not.
PageInfoCropLLX[Index]Defines the X coordinate of the lower left corner of the crop box.
PageInfoCropLLY[Index]Defines the Y coordinate of the lower left corner of the crop box.
PageInfoCropURX[Index]Defines the X coordinate of the upper right corner of the crop box.
PageInfoCropURY[Index]Defines the Y coordinate of the upper right corner of the crop box.
PageInfoHeight[Index]The Height of the page.
PageInfoMediaLLX[Index]Defines the X coordinate of the lower left corner of the media box.
PageInfoMediaLLY[Index]Defines the Y coordinate of the lower left corner of the media box.
PageInfoMediaURX[Index]Defines the X coordinate of the upper right corner of the media box.
PageInfoMediaURY[Index]Defines the Y coordinate of the upper right corner of the media box.
PageInfoRotate[Index]The Rotate value of the page.
PageInfoUserUnit[Index]Defines the size of default user space units.
PageInfoWidth[Index]The Width of the page.
PromoteLongOCSPResponsesWhether long OCSP responses are requested.
PSSUsedWhether RSASSA-PSS mode was used.
QualifiedStatusIndicates a qualified electronic signature.
RC4KeyBitsSpecifies the number of key bits used for RC4 algorithm.
TolerateMinorChainIssuesWhether to tolerate minor chain issues.
TSLDistributionPointsContains XML content of distribution points of the TSL used.
TSLDistributionPoints[Idx]Contains distribution point of the specified index of the TSL used.
TSLHistoricalInformationPeriodContains historical information period of the TSL used.
TSLLegalNoticesContains XML content of legal notices of the TSL used.
TSLLegalNotices[lang]Contains legal notices for the specified language of the TSL used.
TSLListIssueDateTimeContains list issue date and time of the TSL used.
TSLNextUpdateContains next update date and time of the TSL used.
TSLPoliciesContains XML content of policies of the TSL used.
TSLPolicies[lang]Contains policies for the specified language of the TSL used.
TSLSchemeExtensionsContains XML content of scheme extensions of the TSL used.
TSLSchemeExtensions[Idx]Contains XML content of scheme extension of the specified index of the TSL used.
TSLSchemeInformationURIContains XML content of scheme information URI of the TSL used.
TSLSchemeInformationURI[lang]Contains scheme information URI for the specified language of the TSL used.
TSLSchemeNameContains XML content of scheme name of the TSL used.
TSLSchemeName[lang]Contains scheme name for the specified language of the TSL used.
TSLSchemeOperatorAddressContains XML content of scheme operator address of the TSL used.
TSLSchemeOperatorNameContains XML content of scheme operator name of the TSL used.
TSLSchemeOperatorName[lang]Contains scheme operator name for the specified language of the TSL used.
TSLSchemeTerritoryContains scheme territory of the TSL used.
TSLSchemeTypeCommunityRulesContains XML content of scheme type/community/rules of the TSL used.
TSLSchemeTypeCommunityRules[lang]Contains scheme type/community/rules for the specified language of the TSL used.
TSLSequenceNumberContains sequence number of the TSL used.
TSLsRetrieveLogContains the complete log of the TSLs retrieve.
TSLStatusDeterminationApproachContains status determination approach of the TSL used.
TSLsValidationLogContains the complete log of the TSLs validation.
TSLTSPAdditionalServiceInformationContains addtional service information of the TSP service used.
TSLTSPAddressContains XML content of the address of the TSP used.
TSLTSPHistoryInstanceIndicates that TSP service history instance used.
TSLTSPHistoryInstanceAdditionalServiceInformationContains addtional service information of the TSP service history instance used.
TSLTSPHistoryInstanceQualifiersContains list of qualifiers of the TSP service history instance used.
TSLTSPHistoryInstanceServiceInformationExtensionsContains XML content of information extensions of the TSP service history instance used.
TSLTSPHistoryInstanceServiceInformationExtensions[Idx]Contains XML content of information extension of the specified index of the TSP service history instance used.
TSLTSPHistoryInstanceServiceNameContains XML content of name of the TSP service history instance used.
TSLTSPHistoryInstanceServiceName[lang]Contains name for the specified language of the TSP service history instance used.
TSLTSPHistoryInstanceServiceStatusContains status of the TSP service history instance used.
TSLTSPHistoryInstanceServiceStatusStartingTimeContains status starting time of the TSP service history instance used.
TSLTSPHistoryInstanceServiceTypeIdentifierContains type identifier of the TSP service history instance used.
TSLTSPHistoryInstanceXMLContains XML content of the TSP service history instance used.
TSLTSPInformationExtensionsContains XML content of information extensions of the TSP used.
TSLTSPInformationExtensions[Idx]Contains XML content of information extension of the specified index of the TSP used.
TSLTSPInformationURIContains XML content of information URI of the TSP used.
TSLTSPInformationURI[lang]Contains information URI for the specified language of the TSP used.
TSLTSPNameContains XML content of name of the TSP used.
TSLTSPName[lang]Contains name for the specified language of the TSP used.
TSLTSPSchemeServiceDefinitionURIContains XML content of scheme service definition URI of the TSP service used.
TSLTSPSchemeServiceDefinitionURI[lang]Contains scheme service definition URI for the specified language of the TSP service used.
TSLTSPServiceDefinitionURIContains XML content of definition URI of the TSP service used.
TSLTSPServiceDefinitionURI[lang]Contains definition URI for the specified language of the TSP service used.
TSLTSPServiceInformationExtensionsContains XML content of information extensions of the TSP service used.
TSLTSPServiceInformationExtensions[Idx]Contains XML content of information extension of the specified index of the TSP service used.
TSLTSPServiceNameContains XML content of name of the TSP service used.
TSLTSPServiceName[lang]Contains name for the specified language of the TSP service used.
TSLTSPServiceQualifiersContains list of qualifiers of the TSP service used.
TSLTSPServiceStatusContains status of the TSP service used.
TSLTSPServiceStatusStartingTimeContains status starting time of the TSP service used.
TSLTSPServiceSupplyPointsContains XML content of the supply points of the TSP service used.
TSLTSPServiceTypeIdentifierContains type identifier of the TSP service used.
TSLTSPServiceXMLContains XML content of the TSP service used.
TSLTSPTradeNameContains XML content of trade name of the TSP used.
TSLTSPTradeName[lang]Contains trade name for the specified language of the TSP used.
TSLTSPXMLContains XML content of the TSP used.
TSLTypeContains TSL type of the TSL used.
TSLVersionIdentifierContains version identifier of the TSL used.
TSLXMLContains XML content of the TSL used.
UseDefaultTSLsEnables or disables the use of the default TSLs.
UseMicrosoftCTLEnables or disables automatic use of Microsoft online certificate trust list.
UseSystemCertificatesEnables or disables the use of the system certificates.
CheckKeyIntegrityBeforeUseEnables or disable private key integrity check before use.
CookieCachingSpecifies whether a cookie cache should be used for HTTP(S) transports.
CookiesGets or sets local cookies for the component (supported for HTTPClient, RESTClient and SOAPClient only).
DefDeriveKeyIterationsSpecifies the default key derivation algorithm iteration count.
EnableClientSideSSLFFDHEEnables or disables finite field DHE key exchange support in TLS clients.
GlobalCookiesGets or sets global cookies for all the HTTP transports.
HttpUserAgentSpecifies the user agent name to be used by all HTTP clients.
LogDestinationSpecifies the debug log destination.
LogDetailsSpecifies the debug log details to dump.
LogFileSpecifies the debug log filename.
LogFiltersSpecifies the debug log filters.
LogFlushModeSpecifies the log flush mode.
LogLevelSpecifies the debug log level.
LogMaxEventCountSpecifies the maximum number of events to cache before further action is taken.
LogRotationModeSpecifies the log rotation mode.
MaxASN1BufferLengthSpecifies the maximal allowed length for ASN.1 primitive tag data.
MaxASN1TreeDepthSpecifies the maximal depth for processed ASN.1 trees.
OCSPHashAlgorithmSpecifies the hash algorithm to be used to identify certificates in OCSP requests.
UseOwnDNSResolverSpecifies whether the client components should use own DNS resolver.
UseSharedSystemStoragesSpecifies whether the validation engine should use a global per-process copy of the system certificate stores.
UseSystemOAEPAndPSSEnforces or disables the use of system-driven RSA OAEP and PSS computations.
UseSystemRandomEnables or disables the use of the OS PRNG.

Copyright (c) 2022 /n software inc. - All rights reserved.
SecureBlackbox 2020 Kotlin Edition - Version 20.0 [Build 8063]