Document Signing

Full reference for DOCX, CMS, PKCS#7, P7S, file hash, and custom file signing workflows.

All features supported

Every document signing capability listed below is implemented and working on Mobile App and Desktop Software. CMS/PKCS#7 envelopes follow RFC 5652 with CCA India certificate chains.

Overview

Beyond PDF and XML, SecureSign signs arbitrary file types using hash + CMS/PKCS#7 workflows. DOCX signing embeds signatures in Office Open XML structure; P7S files provide detached signature containers for any file type.

  • Hash signing — compute hash server-side, sign via Digital Signing.
  • CMS/PKCS#7 — attached signature envelope with certificate chain.
  • P7S — detached .p7s sidecar file for any document.

Platform Support

FeatureMobile AppDesktop SoftwareREST API
DOCX SigningDeep linkDeep linkPOST /sign/docx
P7S GenerationSupportedDeep linkPOST /sign/p7s
CMS SigningSupportedDeep linkPOST /sign/cms
PKCS#7 SigningSupportedDeep linkPOST /sign/pkcs7
File Hash SigningDeep linkDeep linkPOST /sign/hash
Custom File SigningHash + CMS workflowDeep linkPOST /sign/file

Supported Formats

EndpointInputOutputUse case
POST /sign/docxDOCX base64Signed DOCX base64Word documents with embedded signature
POST /sign/p7sFile hash base64P7S base64Detached signature sidecar (.p7s)
POST /sign/cmsContent base64CMS envelope base64Attached CMS signature
POST /sign/pkcs7Content base64PKCS#7 base64Alias for CMS signing
POST /sign/fileFile base64 + mimeTypeSignature + signed fileGeneric file signing
POST /sign/hashHash base64Raw signature base64Custom integration

Request Fields

Common fields

FieldTypeRequiredDescription
fileBase64stringYes*Base64-encoded file content
hashBase64stringYes*Pre-computed hash (for P7S / hash workflows)
hashAlgostringNoSHA256 (default)
mimeTypestringNoMIME type for /sign/file (e.g. application/pdf)
detachedbooleanNoReturn detached P7S (default true for P7S)
certSerialstringNoPre-select certificate
timestampbooleanNoInclude TSA timestamp

Examples

const params = new URLSearchParams({
  requestId: crypto.randomUUID(),
  hashBase64: sha256Base64,
  hashAlgo: 'SHA256',
  documentType: 'hash',
  callbackUrl: 'https://portal.example.gov.in/sign/callback',
  apiKey: 'ss_live_abc123xyz'
});
window.location.href = `securesign://sign?${params}`;

Custom file signing

securesign://sign?documentType=hash&...
{
  "fileBase64": "UEsDBBQAAAAI...",
  "mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  "hashAlgo": "SHA256",
  "detached": true
}

Response

P7S / CMS

{"success":true,"p7sBase64":"MIIG...","contentType":"application/pkcs7-signature","algorithm":"SHA256withRSA"}

DOCX

{"success":true,"signedFileBase64":"UEsDBBQAAAAI...","signatureField":"Signature1"}

Custom file

{"success":true,"signatureBase64":"MEUCIQD...","p7sBase64":"MIIG...","fileHash":"a1b2c3d4..."}

Errors

CodeCauseResolution
SS_FILE_INVALIDUnsupported or corrupt fileVerify file format and encoding
SS_MIME_TYPE_UNSUPPORTEDUnknown mimeTypeUse supported MIME type or hash workflow
SS_DOCX_SIGNATURE_FAILEDDOCX structure incompatibleEnsure valid Office Open XML document
SS_HASH_INVALIDHash does not match fileRecompute hash server-side

See also Digital Signing and Verification Engine.