Skip to content

PDF

PDF document files with embedded signatures can be verified with Document Rails.

X.509 trusted certificate list is utilised during the verification process.

Output

Name Value Description
kind pdf Credential kind identifier
signatures Signature Signatures detected within the document

Signature

Name Value Description
type complete or partial Identification of the signature document cover range. complete signatures cover the entire document, partial signatures cover part of the document
certificate_chain Certificate chain Certificate chain embedded within the signature

Example output

{
    "credentials": [
        {
            "kind": "pdf",
            "signatures": [
                {
                    "type": "complete",
                    "certificate_chain": [
                        {
                            "not_after_ts": 1785000040,
                            "not_before_ts": 1753464040,
                            "common_name": "Test Cert",
                            "country_name": "XX",
                            "organization_name": "Example",
                            "serial_number": "000000000000000000000000000000",
                            "digest": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
                            "performed_revocation_checks": [
                                {
                                    "type": "crl",
                                    "url": "https://example.com/ca.crl"
                                }
                            ]
                        },
                        {
                            "not_after_ts": 1785000040,
                            "not_before_ts": 1753464040,
                            "common_name": "Intermediate CA",
                            "country_name": "XX",
                            "organization_name": "Example",
                            "serial_number": "000000000000000000000000000000",
                            "digest": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
                        },
                        {
                            "not_after_ts": 1785000040,
                            "not_before_ts": 1753464040,
                            "common_name": "Root CA",
                            "country_name": "XX",
                            "organization_name": "Example",
                            "serial_number": "000000000000000000000000000000",
                            "digest": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
                        }
                    ]
                }
            ]
        }
    ]
}

Example

import { verify, VerifyInputKind } from "@vaultie/document-rails";

const response = await verify(
    client,
    accessToken,
    organizationId,
    {
        input: {
            kind: VerifyInputKind.PDF,
            data: "..."
        },
        trust_registries: [trustRegistryId],
    }
);