Verify

Verify digital signed documents.

Verb Endpoint Action
POST /documents/ Upload a document
GET /documents/{id}/verify/report/ Get the response of the verification process
GET /documents/{id}/ Get the original document uploaded
GET /documents/{id}/content/ Get the document content
GET /documents/{id}/report/ Get the signature of the uploaded document

Upload a document

Allows the upload of a document that needs verification.

Body Parameters:
Parameter Description Required
document The document Yes
content File signature No
verification_date The date in the format YYYY-MM-DDTHH:MM:SS.xxxxxx No
Endpoint:

                /api/documents/
            
Method:

                POST
            
Response

The successful response status code is 201 and the response body contains a JSON with the status code and the location. The location is an alphanumeric string that identifies the document uploaded. It is in the format: /documents/xxxxxxxxxxxxxxxx where xxxxxxxxxxxxxxxx is the id of the document uploaded.

Example

            curl -H "Content-Type: multipart/form-data" -X POST https://vol.uanataca.com/api/documents/ -F "document=@signed.pdf"
            

            {
                "code": "201 Created",
                "location": "/documents/9686d3a083432047"
            }
            

Get response of the verification process

Path parameters:
Parameter Description
id The alphanumeric id of the document uploaded
Body Parameters:
Parameter Description Required
type Format in which the verification report is returned (json - rml) Yes
template Verification report template (report) Yes
lang Language in which the report is to be obtained (it - en) Yes
Endpoint:

                /api/documents/{id}/verify/report/
            
Method:

                GET
            
Response

If the verification process is completed successfully, the status code is 200 and the response body is composed by the string "Verification successful".

Example

            curl -X GET https://vol.uanataca.com/api/documents/9686d3a083432047/verify/report?type=json&template=report&lang=en
            

            Verification Report
            

Get the original document uploaded

Path parameters:
Parameter Description
id The alphanumeric id of the document uploaded
Endpoint:

                /api/documents/{id}/
            
Method:

                GET
            
Response

The server returns the original document uploaded with a status code 200.

Example

            curl -X GET https://vol.uanataca.com/api/documents/9686d3a083432047/
            

            Document
            

Get the document content

This service can be used only after the verification process.

Path parameters:
Parameter Description
id The alphanumeric id of the document uploaded
Endpoint:

                /api/documents/{id}/content/
            
Method:

                GET
            
Response

The successful status code is 200 and the response body is the file content.

Example

            curl -X GET https://vol.uanataca.com/api/documents/9686d3a083432047/content/
            

Get the signature of the uploaded document

Path parameters:
Parameter Description
id The alphanumeric id of the document uploaded
Endpoint:

                /api/documents/{id}/report/
            
Method:

                GET
            
Response

Returns the signature structure associated to the uploaded document. The successful status code is 200.

Example

            curl -X GET https://vol.uanataca.com/api/documents/9686d3a083432047/report/
            

            {
                "code": "200 OK",
                "result": {
                    "report": {
                        "content_type": "1.2.840.113549.1.7.2",
                        "content_name": "signedData",
                        "content": {
                            "version": 1,
                            "digest_algorithm_identifiers": [
                                {
                                    "oid": "2.16.840.1.101.3.4.2.1",
                                    "name": "sha256",
                                    "parameters": null
                                }
                            ],
                            "content": {
                                "content_type": "1.2.840.113549.1.7.1",
                                "content_name": "data",
                                "content": {
                                    "$DER": "BIIJXTCCCVkwgghBoAMCAQICEGU..."
                                }
                            },
                            "certificates": [
                                {
                                    "version": 3,
                                    "serial_number": {
                                        "hex": "19f3405c81cfadde",
                                        "integer": "1869909036347928030"
                                    },
                                    "signature_algorithm": {
                                        "oid": "1.2.840.113549.1.1.11",
                                        "name": "sha256WithRSAEncryption",
                                        "parameters": null
                                    },
                                    "issuer": {
                                        "x500name": "2.5.4.97=VATES-A66721499,CN=UANATACA CA1 2016,OU=TSP-UANATACA,O=UANATACA S.A.,L=Barcelona (see current address at www.uanataca.com/address),C=ES",
                                        "items": [
                                            {
                                                "oid": "2.5.4.6",
                                                "x500_name": "country",
                                                "x500_short_name": "C",
                                                "value": "ES",
                                                "charset": "PRINTABLE_STRING"
                                            },
                                            {
                                                "oid": "2.5.4.7",
                                                "x500_name": "locality",
                                                "x500_short_name": "L",
                                                "value": "Barcelona (see current address at www.uanataca.com/address)",
                                                "charset": "UTF8_STRING"
                                            },
                                            {
                                                "oid": "2.5.4.10",
                                                "x500_name": "organization",
                                                "x500_short_name": "O",
                                                "value": "UANATACA S.A.",
                                                "charset": "UTF8_STRING"
                                            },
                                            {
                                                "oid": "2.5.4.11",
                                                "x500_name": "organizationalUnit",
                                                "x500_short_name": "OU",
                                                "value": "TSP-UANATACA",
                                                "charset": "UTF8_STRING"
                                            },
                                            {
                                                "oid": "2.5.4.3",
                                                "x500_name": "commonName",
                                                "x500_short_name": "CN",
                                                "value": "UANATACA CA1 2016",
                                                "charset": "UTF8_STRING"
                                            },
                                            {
                                                "oid": "2.5.4.97",
                                                "x500_name": "organizationIdentifier",
                                                "x500_short_name": null,
                                                "value": "VATES-A66721499",
                                                "charset": "UTF8_STRING"
                                            }
                                        ]
                                    },
                                    "not_before": {
                                        "option": "UTC_TIME",
                                        "utc": true,
                                        "value": "2017-04-14T22:55:00"
                                    },
                                    "not_after": {
                                        "option": "UTC_TIME",
                                        "utc": true,
                                        "value": "2019-04-14T22:55:00"
                                    },
                                    "subject": {
                                        "x500name": "CN=Test Cert,SERIALNUMBER=TC1234567,G=Test,SN=Cert,C=ES",
                                        "items": [
                                            {
                                                "oid": "2.5.4.6",
                                                "x500_name": "country",
                                                "x500_short_name": "C",
                                                "value": "ES",
                                                "charset": "PRINTABLE_STRING"
                                            },
                                            {
                                                "oid": "2.5.4.4",
                                                "x500_name": "surname",
                                                "x500_short_name": "SN",
                                                "value": "Cert",
                                                "charset": "UTF8_STRING"
                                            },
                                            {
                                                "oid": "2.5.4.42",
                                                "x500_name": "givenName",
                                                "x500_short_name": "G",
                                                "value": "Test",
                                                "charset": "UTF8_STRING"
                                            },
                                            {
                                                "oid": "2.5.4.5",
                                                "x500_name": "deviceSerialNumber",
                                                "x500_short_name": "SERIALNUMBER",
                                                "value": "TC1234567",
                                                "charset": "PRINTABLE_STRING"
                                            },
                                            {
                                                "oid": "2.5.4.3",
                                                "x500_name": "commonName",
                                                "x500_short_name": "CN",
                                                "value": "Test Cert",
                                                "charset": "UTF8_STRING"
                                            }
                                        ]
                                    },
                                    "public_key_algorithm": {
                                        "oid": "1.2.840.113549.1.1.1",
                                        "name": "rsaEncryption",
                                        "parameters": null
                                    },
                                    "public_key": {
                                        "bits": 2048,
                                        "modulus": "00c6ff0e6c65f0b5cad1...",
                                        "public_exponent": "010001"
                                    },
                                    "issuer_unique_id": null,
                                    "subject_unique_id": null,
                                    "extensions": [
                                        {
                                            "oid": "2.5.29.9",
                                            "name": "subjectDirectoryAttributes",
                                            "critical": false,
                                            "value": {
                                                "$DER": "MCQwEAYIKwYBBQUHCQUxBBMCSVQwEAYIKwYBBQUHCQQxBBMCSVQ="
                                            }
                                        },
                                        {
                                            "oid": "1.3.6.1.5.5.7.1.1",
                                            "name": "authorityInfoAccess",
                                            "critical": false,
                                            "value": [
                                                {
                                                    "oid": "1.3.6.1.5.5.7.48.2",
                                                    "name": "caIssuers",
                                                    "location": {
                                                        "option": "URI",
                                                        "value": "http://www.uanataca.com/public/download/tsp_certificates/trustedRoot.p7c"
                                                    }
                                                },
                                                {
                                                    "oid": "1.3.6.1.5.5.7.48.1",
                                                    "name": "OCSP",
                                                    "location": {
                                                        "option": "URI",
                                                        "value": "http://ocsp1.uanataca.com/public/pki/ocsp/"
                                                    }
                                                },
                                                {
                                                    "oid": "1.3.6.1.5.5.7.48.1",
                                                    "name": "OCSP",
                                                    "location": {
                                                        "option": "URI",
                                                        "value": "http://ocsp2.uanataca.com/public/pki/ocsp/"
                                                    }
                                                }
                                            ]
                                        },
                                        {
                                            "oid": "2.5.29.14",
                                            "name": "subjectKeyIdentifier",
                                            "critical": false,
                                            "value": "211e79493bab5824abe7c30bfc123a749fc927f5"
                                        },
                                        {
                                            "oid": "2.5.29.19",
                                            "name": "basicConstraints",
                                            "critical": true,
                                            "value": {
                                                "ca": null,
                                                "path_len": null
                                            }
                                        },
                                        {
                                            "oid": "2.5.29.35",
                                            "name": "authorityKeyIdentifier",
                                            "critical": false,
                                            "value": {
                                                "key_identifier": "2d71efb0637ff5fde08322447f441030814f4de5",
                                                "authority_cert_issuer": null,
                                                "authority_cert_serial_number": null
                                            }
                                        },
                                        {
                                            "oid": "1.3.6.1.5.5.7.1.3",
                                            "name": "qcStatements",
                                            "critical": false,
                                            "value": [
                                                {
                                                    "oid": "0.4.0.1862.1.1",
                                                    "name": "QcCompliance",
                                                    "description": "Statement claiming that the certificate is a Qualified Certificate",
                                                    "info": null
                                                },
                                                {
                                                    "oid": "0.4.0.1862.1.3",
                                                    "name": "QcRetentionPeriod",
                                                    "description": "Statement indicating the duration of the retention period of material information",
                                                    "info": 15
                                                },
                                                {
                                                    "oid": "0.4.0.1862.1.4",
                                                    "name": "QcSSCD",
                                                    "description": "Statement claiming that the private key related to the certified public key resides in a Secure Signature Creation Device (SSCD)",
                                                    "info": null
                                                }
                                            ]
                                        },
                                        {
                                            "oid": "2.5.29.32",
                                            "name": "certificatePolicies",
                                            "critical": false,
                                            "value": [
                                                {
                                                    "oid": "1.3.6.1.4.1.47286.1.1.2.1",
                                                    "name": null,
                                                    "description": null,
                                                    "qualifiers": [
                                                        {
                                                            "oid": "1.3.6.1.5.5.7.2.1",
                                                            "name": "CPS",
                                                            "value": "http://www.uanataca.com/public/pki/dpc/"
                                                        },
                                                        {
                                                            "oid": "1.3.6.1.5.5.7.2.2",
                                                            "name": "UserNotice",
                                                            "value": {
                                                                "reference": null,
                                                                "text": "Certificado electrónico de persona física que funciona con DCCF para autenticación. Ver http://www.uanataca.com/public/pki/dpc/"
                                                            }
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        {
                                            "oid": "2.5.29.31",
                                            "name": "cRLDistributionPoints",
                                            "critical": false,
                                            "value": [
                                                {
                                                    "option": "URI",
                                                    "value": "http://crl1.uanataca.com/public/pki/crl/CA1subordinada.crl"
                                                },
                                                {
                                                    "option": "URI",
                                                    "value": "http://crl2.uanataca.com/public/pki/crl/CA1subordinada.crl"
                                                }
                                            ]
                                        },
                                        {
                                            "oid": "2.5.29.15",
                                            "name": "keyUsage",
                                            "critical": true,
                                            "value": [
                                                "digitalSignature"
                                            ]
                                        },
                                        {
                                            "oid": "2.5.29.37",
                                            "name": "extendedKeyUsage",
                                            "critical": false,
                                            "value": [
                                                {
                                                    "oid": "1.3.6.1.5.5.7.3.2",
                                                    "name": "clientAuthentication"
                                                },
                                                {
                                                    "oid": "1.3.6.1.5.5.7.3.4",
                                                    "name": "eMailProtection"
                                                }
                                            ]
                                        },
                                        {
                                            "oid": "2.5.29.17",
                                            "name": "subjectAlternativeName",
                                            "critical": false,
                                            "value": [
                                                {
                                                    "option": "MAIL_ADDRESS",
                                                    "value": "dci@bit4id.com"
                                                }
                                            ]
                                        }
                                    ],
                                    "signature": "5a683836c255f57ad002b7d79b3f2..."
                                }
                            ],
                            "revocation_infos": [],
                            "signer_infos": [
                                {
                                    "version": 1,
                                    "issuer_and_serial_number": {
                                        "issuer": {
                                            "x500name": "2.5.4.97=VATES-A66721499,CN=UANATACA CA1 2016,OU=TSP-UANATACA,O=UANATACA S.A.,L=Barcelona (see current address at www.uanataca.com/address),C=ES",
                                            "items": [
                                                {
                                                    "oid": "2.5.4.6",
                                                    "x500_name": "country",
                                                    "x500_short_name": "C",
                                                    "value": "ES",
                                                    "charset": "PRINTABLE_STRING"
                                                },
                                                {
                                                    "oid": "2.5.4.7",
                                                    "x500_name": "locality",
                                                    "x500_short_name": "L",
                                                    "value": "Barcelona (see current address at www.uanataca.com/address)",
                                                    "charset": "UTF8_STRING"
                                                },
                                                {
                                                    "oid": "2.5.4.10",
                                                    "x500_name": "organization",
                                                    "x500_short_name": "O",
                                                    "value": "UANATACA S.A.",
                                                    "charset": "UTF8_STRING"
                                                },
                                                {
                                                    "oid": "2.5.4.11",
                                                    "x500_name": "organizationalUnit",
                                                    "x500_short_name": "OU",
                                                    "value": "TSP-UANATACA",
                                                    "charset": "UTF8_STRING"
                                                },
                                                {
                                                    "oid": "2.5.4.3",
                                                    "x500_name": "commonName",
                                                    "x500_short_name": "CN",
                                                    "value": "UANATACA CA1 2016",
                                                    "charset": "UTF8_STRING"
                                                },
                                                {
                                                    "oid": "2.5.4.97",
                                                    "x500_name": "organizationIdentifier",
                                                    "x500_short_name": null,
                                                    "value": "VATES-A66721499",
                                                    "charset": "UTF8_STRING"
                                                }
                                            ]
                                        },
                                        "serial_number": {
                                            "hex": "19f3405c81cfadde",
                                            "integer": "1869909036347928030"
                                        }
                                    },
                                    "subject_key_identifier": null,
                                    "digest_algorithm": {
                                        "oid": "2.16.840.1.101.3.4.2.1",
                                        "name": "sha256",
                                        "parameters": null
                                    },
                                    "signed_attributes": [
                                        {
                                            "oid": "1.2.840.113549.1.9.3",
                                            "name": "contentType",
                                            "value": {
                                                "oid": "1.2.840.113549.1.7.1",
                                                "name": "data"
                                            }
                                        },
                                        {
                                            "oid": "1.2.840.113549.1.9.5",
                                            "name": "signingTime",
                                            "value": "2017-04-19T10:55:08"
                                        },
                                        {
                                            "oid": "1.2.840.113549.1.9.4",
                                            "name": "messageDigest",
                                            "value": "fc1ff3d3ad900da874e1b63428d7a8fd95fb6a2a3c139c1ff9dfe0e624f44698"
                                        },
                                        {
                                            "oid": "1.2.840.113549.1.9.16.2.47",
                                            "name": "signingCertificateV2",
                                            "value": {
                                                "certs": [
                                                    {
                                                        "hash": "184715fe8e0bf72f53a0ba8e4e61b2c8da102691a751bafd5a553cf2bf042b46",
                                                        "issuer_serial": {
                                                            "issuer": [
                                                                {
                                                                    "option": "DIRECTORY",
                                                                    "value": {
                                                                        "x500name": "2.5.4.97=VATES-A66721499,CN=UANATACA CA1 2016,OU=TSP-UANATACA,O=UANATACA S.A.,L=Barcelona (see current address at www.uanataca.com/address),C=ES",
                                                                        "items": [
                                                                            {
                                                                                "oid": "2.5.4.6",
                                                                                "x500_name": "country",
                                                                                "x500_short_name": "C",
                                                                                "value": "ES",
                                                                                "charset": "PRINTABLE_STRING"
                                                                            },
                                                                            {
                                                                                "oid": "2.5.4.7",
                                                                                "x500_name": "locality",
                                                                                "x500_short_name": "L",
                                                                                "value": "Barcelona (see current address at www.uanataca.com/address)",
                                                                                "charset": "UTF8_STRING"
                                                                            },
                                                                            {
                                                                                "oid": "2.5.4.10",
                                                                                "x500_name": "organization",
                                                                                "x500_short_name": "O",
                                                                                "value": "UANATACA S.A.",
                                                                                "charset": "UTF8_STRING"
                                                                            },
                                                                            {
                                                                                "oid": "2.5.4.11",
                                                                                "x500_name": "organizationalUnit",
                                                                                "x500_short_name": "OU",
                                                                                "value": "TSP-UANATACA",
                                                                                "charset": "UTF8_STRING"
                                                                            },
                                                                            {
                                                                                "oid": "2.5.4.3",
                                                                                "x500_name": "commonName",
                                                                                "x500_short_name": "CN",
                                                                                "value": "UANATACA CA1 2016",
                                                                                "charset": "UTF8_STRING"
                                                                            },
                                                                            {
                                                                                "oid": "2.5.4.97",
                                                                                "x500_name": "organizationIdentifier",
                                                                                "x500_short_name": null,
                                                                                "value": "VATES-A66721499",
                                                                                "charset": "UTF8_STRING"
                                                                            }
                                                                        ]
                                                                    }
                                                                }
                                                            ],
                                                            "serial_number": {
                                                                "hex": "19f3405c81cfadde",
                                                                "integer": "1869909036347928030"
                                                            }
                                                        }
                                                    }
                                                ],
                                                "policies": []
                                            }
                                        }
                                    ],
                                    "signature_algorithm": {
                                        "oid": "1.2.840.113549.1.1.11",
                                        "name": "sha256WithRSAEncryption",
                                        "parameters": null
                                    },
                                    "unsigned_attributes": []
                                }
                            ]
                        }
                    },
                    "errors": [
                        {
                            "where": "pkcs7/signedData/certificates/0/x509/extensions/qcStatements/QcPDS",
                            "what": "INVALID_ENCODING"
                        }
                    ]
                }
            }