{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/infocert/main/json-schema/infocert-one-shot-sign-request-schema.json",
  "title": "OneShotSignRequest",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/infocert-sign-openapi.yml#/components/schemas/OneShotSignRequest",
  "type": "object",
  "properties": {
    "applicationId": {
      "type": "string"
    },
    "authorization": {
      "$ref": "#/$defs/AuthorizationData"
    },
    "emitCertificateRequest": {
      "$ref": "#/$defs/EmitCertificateRequest"
    },
    "asicSignatures": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AsicSignature"
      }
    },
    "cadesSignatures": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CadesSignature"
      }
    },
    "hashSignatures": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HashSignature"
      }
    },
    "padesSignatures": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PadesSignature"
      }
    },
    "xadesSignatures": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/XadesSignature"
      }
    }
  },
  "$defs": {
    "AsicSignature": {
      "type": "object",
      "title": "AsicSignature",
      "description": "parameters to be used for asic signature",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "signatureType": {
          "type": "string",
          "enum": [
            "CAdES",
            "XAdES"
          ],
          "description": "signature type"
        },
        "signatureLevel": {
          "type": "string",
          "enum": [
            "BASELINE-B",
            "BASELINE-T",
            "BASELINE-LT",
            "BASELINE-LTV"
          ]
        },
        "containerType": {
          "type": "string",
          "enum": [
            "ASiC_S",
            "ASiC_E"
          ],
          "description": "container type"
        },
        "documents": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Document"
          }
        }
      },
      "required": [
        "requestId",
        "signatureType",
        "signatureLevel",
        "containerType",
        "documents"
      ]
    },
    "Assertion": {
      "type": "object",
      "title": "Assertion",
      "properties": {
        "type_proof": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "AuthorizationData": {
      "type": "object",
      "title": "AuthorizationData",
      "properties": {
        "sat": {
          "$ref": "#/$defs/sat"
        },
        "sac": {
          "$ref": "#/$defs/sac"
        },
        "sacSchema": {
          "$ref": "#/$defs/sacSchema"
        },
        "transactionId": {
          "type": "string"
        },
        "otp": {
          "type": "string"
        },
        "authorizedSignatures": {
          "type": "integer",
          "format": "int32"
        },
        "authorizedDigests": {
          "$ref": "#/$defs/SignatureDigests"
        }
      }
    },
    "CadesSignature": {
      "type": "object",
      "title": "CadesSignature",
      "description": "parameters to be used for CADES signature",
      "properties": {
        "counterSignCertificate": {
          "type": "string",
          "description": "counter sign certificate used for CADES signatures",
          "format": "byte"
        },
        "parallelSign": {
          "type": "boolean",
          "description": "should signature happen in parallel"
        }
      },
      "allOf": [
        {
          "$ref": "#/$defs/Signature"
        }
      ]
    },
    "CertificateParams": {
      "type": "object",
      "title": "CertificateParams",
      "properties": {
        "template": {
          "type": "string",
          "description": "NOVA template"
        },
        "qtsp": {
          "type": "string",
          "description": "Qualified Trusted Service Provider"
        },
        "domain": {
          "type": "string",
          "description": "NOVA domain"
        },
        "subject": {
          "type": "string",
          "description": "NOVA subject"
        },
        "updateSubject": {
          "type": "string",
          "description": "NOVA subject for state change"
        },
        "lifetime": {
          "type": "string",
          "description": "It indicates duration of the certificate lifetime as defined in ISO 8601 and rfc3339.",
          "format": "duration",
          "pattern": "^P(?!$)(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(T(?=\\d+[HMS])(\\d+H)?(\\d+M)?(\\d+S)?)?$\n"
        },
        "effectiveDate": {
          "type": "string",
          "format": "date-time"
        },
        "expirationDate": {
          "type": "string",
          "format": "date-time"
        },
        "isPinToInitialize": {
          "type": "boolean",
          "description": "Create or not a certificate in Deactive state"
        },
        "eccOID": {
          "type": "string",
          "description": "the OID to use in elliptic curve certificate"
        },
        "dnqType": {
          "type": "string",
          "enum": [
            "UUID",
            "INFO"
          ],
          "description": "Requested DNQ format"
        },
        "checkReputation": {
          "type": "boolean",
          "description": "Operational anti-fraud controls",
          "default": false
        },
        "tenantId": {
          "type": "string",
          "description": "TenantId configuration to pass to the integrated systems."
        }
      }
    },
    "CommitmentType": {
      "type": "object",
      "title": "CommitmentType",
      "properties": {
        "proofOfCreation": {
          "type": "boolean"
        },
        "proofOfApproval": {
          "type": "boolean"
        },
        "proofOfDelivery": {
          "type": "boolean"
        },
        "proofOfOrigin": {
          "type": "boolean"
        },
        "proofOfReceipt": {
          "type": "boolean"
        },
        "proofOfSender": {
          "type": "boolean"
        }
      }
    },
    "Contact": {
      "type": "object",
      "title": "Contact",
      "properties": {
        "email": {
          "type": "string"
        },
        "telephone": {
          "type": "string"
        },
        "address": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "municipality": {
          "type": "string"
        },
        "province": {
          "type": "string"
        },
        "country": {
          "type": "string"
        }
      }
    },
    "DigestDocument": {
      "type": "object",
      "title": "DigestDocument",
      "properties": {
        "content": {
          "type": "string",
          "description": "the inline digest  to sign",
          "format": "byte"
        },
        "algo": {
          "type": "string",
          "enum": [
            "SHA-256",
            "SHA-384",
            "SHA-512"
          ],
          "description": "The algoritm used to compute the digest"
        }
      }
    },
    "Document": {
      "type": "object",
      "title": "Document",
      "properties": {
        "content": {
          "type": "string",
          "description": "the inline content to sign",
          "format": "byte"
        },
        "contentType": {
          "type": "string"
        },
        "attachName": {
          "type": "string"
        },
        "digest": {
          "$ref": "#/$defs/DigestDocument"
        }
      }
    },
    "EmitCertificateRequest": {
      "type": "object",
      "title": "EmitCertificateRequest",
      "properties": {
        "productId": {
          "type": "string"
        },
        "requestUuid": {
          "type": "string"
        },
        "assertions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Assertion"
          }
        },
        "holder": {
          "$ref": "#/$defs/Holder"
        },
        "pin": {
          "type": "string"
        },
        "certificate": {
          "$ref": "#/$defs/CertificateParams"
        }
      }
    },
    "HashSignature": {
      "type": "object",
      "title": "HashSignature",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "hash": {
          "type": "string",
          "format": "byte"
        },
        "withTimestamp": {
          "type": "boolean",
          "description": "If true, the timestamp is applied to the hash"
        }
      },
      "required": [
        "requestId",
        "hash"
      ]
    },
    "Holder": {
      "type": "object",
      "title": "Holder",
      "properties": {
        "personalDetails": {
          "$ref": "#/$defs/PersonalDetails"
        },
        "identification": {
          "nullable": false,
          "allOf": [
            {
              "$ref": "#/$defs/PersonIdentification"
            }
          ]
        },
        "contact": {
          "nullable": false,
          "allOf": [
            {
              "$ref": "#/$defs/Contact"
            }
          ]
        },
        "organization": {
          "$ref": "#/$defs/Organization"
        },
        "locality": {
          "type": "string"
        }
      },
      "required": [
        "identification",
        "contact"
      ]
    },
    "Organization": {
      "type": "object",
      "title": "Organization",
      "properties": {
        "name": {
          "type": "string",
          "description": "Organization Name of subjectDN"
        },
        "id": {
          "type": "string",
          "description": "Organization Identifier of subjectDN"
        },
        "title": {
          "type": "string",
          "description": "Title of subjectDN"
        },
        "units": {
          "type": "array",
          "description": "Organizational Unit Name of subjectDN",
          "items": {
            "type": "string"
          }
        },
        "country": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "id"
      ]
    },
    "PadesSignature": {
      "type": "object",
      "title": "PadesSignature",
      "description": "Parameters to be used for PADES Signature",
      "properties": {
        "signatureFields": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SignatureField"
          }
        },
        "isVisible": {
          "type": "boolean",
          "description": "The signature is visible"
        },
        "reason": {
          "type": "string",
          "description": "The reason for the signature. This field is only effective if `isVisible` is `false`."
        },
        "location": {
          "type": "string",
          "description": "The location where the signature was made. This field is only effective if `isVisible` is `false`."
        },
        "baselineLTVmode": {
          "type": "string",
          "enum": [
            "ALL",
            "SELECTIVE"
          ],
          "default": "ALL"
        },
        "removeNeedAppearance": {
          "type": "boolean",
          "description": "If true, the PDF is analyzed and possibly corrected before signatures are applied. No changes are made if the PDF file already contains signatures.",
          "default": false
        }
      },
      "allOf": [
        {
          "$ref": "#/$defs/Signature"
        }
      ]
    },
    "PersonDocument": {
      "type": "object",
      "title": "PersonDocument",
      "properties": {
        "type": {
          "type": "string"
        },
        "number": {
          "type": "string"
        },
        "emitter": {
          "type": "string"
        },
        "emissionDate": {
          "type": "string"
        },
        "endOfValidityDate": {
          "type": "string"
        },
        "country": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "number"
      ]
    },
    "PersonIdentification": {
      "type": "object",
      "title": "PersonIdentification",
      "properties": {
        "type": {
          "type": "string"
        },
        "document": {
          "$ref": "#/$defs/PersonDocument"
        },
        "requester": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "externalSignerId": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "country"
      ]
    },
    "PersonalDetails": {
      "type": "object",
      "title": "PersonalDetails",
      "properties": {
        "firstName": {
          "type": "string"
        },
        "lastName": {
          "type": "string"
        },
        "countryCode": {
          "type": "string"
        },
        "serialNumber": {
          "type": "string"
        },
        "dateOfBirth": {
          "type": "string"
        },
        "gender": {
          "type": "string"
        },
        "nationality": {
          "type": "string"
        },
        "birthPlace": {
          "type": "string"
        }
      },
      "required": [
        "firstName",
        "lastName",
        "countryCode",
        "serialNumber"
      ]
    },
    "ProductionPlacement": {
      "type": "object",
      "title": "ProductionPlacement",
      "properties": {
        "city": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "stateOrProvince": {
          "type": "string"
        },
        "country": {
          "type": "string"
        }
      }
    },
    "Signature": {
      "type": "object",
      "title": "Signature",
      "properties": {
        "signatureLevel": {
          "type": "string",
          "enum": [
            "BASELINE-B",
            "BASELINE-T",
            "BASELINE-LT",
            "BASELINE-LTV"
          ]
        },
        "requestId": {
          "type": "string"
        },
        "document": {
          "$ref": "#/$defs/Document"
        },
        "packaging": {
          "type": "string",
          "enum": [
            "ENVELOPED",
            "ENVELOPING",
            "DETACHED",
            "COUNTERSIG"
          ]
        }
      },
      "required": [
        "signatureLevel",
        "requestId",
        "document",
        "packaging"
      ]
    },
    "SignatureDigests": {
      "type": "object",
      "title": "SignatureDigests",
      "properties": {
        "documentDigests": {
          "type": "array",
          "description": "List of document digests (used for document and document_digest signatures)",
          "items": {
            "type": "string"
          }
        },
        "dtbsDigests": {
          "type": "array",
          "description": "List of dtbs digests (used for hash signatures)",
          "items": {
            "type": "string"
          }
        },
        "digestAlgorithm": {
          "type": "string",
          "description": "Digest algorithm specification",
          "pattern": "^(SHA-256|SHA-384|SHA-512|SHA3-256|SHA3-384|SHA3-512)$"
        }
      },
      "allOf": [
        {
          "if": {
            "required": [
              "document_digests"
            ]
          },
          "then": {
            "required": [
              "digest_algorithm"
            ]
          }
        }
      ]
    },
    "SignatureField": {
      "type": "object",
      "title": "SignatureField",
      "description": "Signature fields presentation for PADES signatures",
      "properties": {
        "name": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        },
        "reasonLabel": {
          "type": "string"
        },
        "location": {
          "type": "string"
        },
        "locationLabel": {
          "type": "string"
        },
        "contactInfo": {
          "type": "string"
        },
        "signedByLabel": {
          "type": "string"
        },
        "signatureDateLabel": {
          "type": "string"
        },
        "timestamp": {
          "type": "boolean"
        },
        "isPdfa": {
          "type": "boolean"
        },
        "keyword": {
          "type": "string"
        },
        "position": {
          "$ref": "#/$defs/SignatureFieldPosition"
        },
        "font": {
          "type": "string",
          "enum": [
            "HELR45W",
            "COURIER",
            "COURIERNEW",
            "ROBOTOMONO",
            "OPENSANS"
          ]
        },
        "fontSize": {
          "type": "integer",
          "format": "int32"
        },
        "lengthField": {
          "type": "integer",
          "format": "int32"
        },
        "widthField": {
          "type": "integer",
          "format": "int32"
        },
        "timezone": {
          "type": "string",
          "description": "signature field timezone id"
        },
        "visibleText": {
          "type": "string",
          "description": "signature field free text visible. Overwrite default value."
        },
        "signatureImage": {
          "type": "string",
          "format": "byte"
        },
        "avoidGraphicLayers": {
          "type": "boolean",
          "description": "signature fields presentation for PADES signatures"
        }
      }
    },
    "SignatureFieldPosition": {
      "type": "object",
      "title": "SignatureFieldPosition",
      "properties": {
        "page": {
          "type": "integer",
          "format": "int32"
        },
        "llx": {
          "type": "integer",
          "format": "int32"
        },
        "lly": {
          "type": "integer",
          "format": "int32"
        },
        "urx": {
          "type": "integer",
          "format": "int32"
        },
        "ury": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "XadesSignature": {
      "type": "object",
      "title": "XadesSignature",
      "description": "parameters to be used for XADES signature",
      "properties": {
        "signatureFormat": {
          "type": "string",
          "enum": [
            "ETSI EN 319 132",
            "ETSI TS 103 171"
          ],
          "description": "only 'ETSI EN 319 132' supported in the current implementation"
        },
        "productionPlacement": {
          "$ref": "#/$defs/ProductionPlacement"
        },
        "commitmentType": {
          "$ref": "#/$defs/CommitmentType"
        },
        "xpathExpression": {
          "$ref": "#/$defs/XpathExpression"
        },
        "signerRole": {
          "type": "string",
          "description": "Signer Role"
        },
        "signingTime": {
          "type": "string",
          "format": "date-time"
        },
        "isSHA1DigestEnabled": {
          "type": "boolean"
        },
        "canonicalizationWithoutCommentsEnabled": {
          "type": "boolean"
        },
        "includePublicKey": {
          "type": "boolean"
        },
        "signatureIdToCounterSign": {
          "type": "string"
        },
        "profile": {
          "type": "string"
        }
      },
      "allOf": [
        {
          "$ref": "#/$defs/Signature"
        }
      ]
    },
    "XpathExpression": {
      "type": "object",
      "title": "XpathExpression",
      "properties": {
        "xPathFilterType": {
          "type": "string",
          "enum": [
            "SUBSTRACT",
            "INTERSECT"
          ]
        },
        "checkValidXpathBeforeSignature": {
          "type": "boolean"
        },
        "xPathExpression": {
          "type": "string"
        }
      }
    },
    "sac": {
      "type": "string"
    },
    "sacSchema": {
      "type": "string"
    },
    "sat": {
      "type": "string"
    }
  }
}