Constructors

Methods

  • Parameters

    • batchId: string
    • OptionalabortController: AbortController

    Returns Promise<{ status?: "FINISHED" | "NOT_FINISHED" }>

  • Makes sure Autogram is running (launching it if needed) and returns its info. With minimumAppVersion an older Autogram emits the appVersionTooLow state and throws AutogramAppVersionTooLowException.

    Parameters

    • OptionalabortController: AbortController
    • OptionalonStateChange: DesktopSigningStateConsumer
    • Optionaloptions: { minimumAppVersion?: string }

    Returns Promise<
        {
            availableDrivers?: (
                | "eid"
                | "cz_eid"
                | "secure_store"
                | "monet"
                | "gemalto"
                | "fake"
                | "keystore"
                | "custom_pkcs11"
            )[];
            features?: (
                | "CONTENT_TIMESTAMP"
                | "EXTERNAL_CONTENT_TIMESTAMP"
                | "TIMESTAMP"
                | "EN319132"
                | "BATCH_SIGN"
                | "PDF_A_CHECK"
                | "PDF_EMBEDDED_ATTACHMENTS_CHECK"
                | "SIGNING_CERTIFICATE_QUALIFIED_CHECK"
                | "PADES"
                | "PADES_VISUAL_SIGNATURE"
                | "CADES"
                | "XADES"
                | "ASICE"
                | "ASICE_MULTIPLE_DOCUMENTS"
                | "ASICS"
                | "AUTOLOAD_EFORMS"
                | "XDC_SIGN"
                | "XDC_VISUALIZE"
                | "XDC_CREATE"
                | "XDC_EMBEDDED_SIGN"
                | "XDC_EMBEDDED_VISUALIZE"
                | "XDC_EMBEDDED_CREATE"
                | "SIGNATURE_VALIDATION"
            )[];
            status?: "READY";
            version?: string;
        },
    >

  • Signs one or more documents. Multiple documents are signed together into a single ASiC_E container ("spoločná autorizácia dokumentov").

    Autogram >= 2.8.0 is used via POST /api/v1/sign. Older versions fall back to the legacy POST /sign endpoint, which supports one document only – signing multiple documents (or requesting v1-only checks) with an older Autogram emits the appVersionTooLow state and throws AutogramAppVersionTooLowException (code app-version-too-low).

    Parameters

    • documents: DocumentToSign | DocumentToSign[]

      document(s) to sign, each with its own mimeType/encoding and optional xdcParameters

    • Optionalparameters: {
          checkPDFACompliance?: boolean;
          checkPDFEmbeddedAttachments?: boolean;
          container?: null | "ASiC_E";
          digestAlgorithm?: null | "SHA256" | "SHA384" | "SHA512";
          form?: null | "XAdES" | "PAdES" | "CAdES";
          infoCanonicalization?:
              | null
              | "INCLUSIVE"
              | "EXCLUSIVE"
              | "INCLUSIVE_WITH_COMMENTS"
              | "EXCLUSIVE_WITH_COMMENTS"
              | "INCLUSIVE_11"
              | "INCLUSIVE_11_WITH_COMMENTS";
          keyInfoCanonicalization?: | null
          | "INCLUSIVE"
          | "EXCLUSIVE"
          | "INCLUSIVE_WITH_COMMENTS"
          | "EXCLUSIVE_WITH_COMMENTS"
          | "INCLUSIVE_11"
          | "INCLUSIVE_11_WITH_COMMENTS";
          packaging?: null
          | "ENVELOPED"
          | "ENVELOPING";
          profile?: null | "BASELINE_B" | "BASELINE_T";
          propertiesCanonicalization?:
              | null
              | "INCLUSIVE"
              | "EXCLUSIVE"
              | "INCLUSIVE_WITH_COMMENTS"
              | "EXCLUSIVE_WITH_COMMENTS"
              | "INCLUSIVE_11"
              | "INCLUSIVE_11_WITH_COMMENTS";
      } & { en319132?: boolean; requireQualifiedCertificate?: boolean }
      • OptionalcheckPDFACompliance?: boolean

        Check for PDF/A compliance and show warning if not compliant.

        false
        
      • OptionalcheckPDFEmbeddedAttachments?: boolean

        Check for attachments embedded inside PDF file and show warning if any are found.

        false
        
      • Optionalcontainer?: null | "ASiC_E"

        Optional container type that should be used to place the file with signature to. Defaults to null. For a document with xdcParameters.autoLoadEform=true, this value can be overridden by the resolved eForm requirements.

        ASiC_E
        @enum {string}
      • OptionaldigestAlgorithm?: null | "SHA256" | "SHA384" | "SHA512"

        Optional algorithm used to calculate digests.

        SHA256
        @enum {string}
      • Optionalform?: null | "XAdES" | "PAdES" | "CAdES"

        Signature format. Format PAdES is usable only with documents of type application/pdf. Format XAdES is usable with XML or with any file type if using an ASiC container. Format is not required when signing already signed documents - PAdES or ASiC-E.

        XAdES
        @enum {string}
      • OptionalinfoCanonicalization?:
            | null
            | "INCLUSIVE"
            | "EXCLUSIVE"
            | "INCLUSIVE_WITH_COMMENTS"
            | "EXCLUSIVE_WITH_COMMENTS"
            | "INCLUSIVE_11"
            | "INCLUSIVE_11_WITH_COMMENTS"

        Optional info canonicalization method.

        INCLUSIVE
        @enum {string}
      • OptionalkeyInfoCanonicalization?:
            | null
            | "INCLUSIVE"
            | "EXCLUSIVE"
            | "INCLUSIVE_WITH_COMMENTS"
            | "EXCLUSIVE_WITH_COMMENTS"
            | "INCLUSIVE_11"
            | "INCLUSIVE_11_WITH_COMMENTS"

        Optional key info canonicalization method.

        INCLUSIVE
        @enum {string}
      • Optionalpackaging?: null | "ENVELOPED" | "ENVELOPING"

        Optional form of packaging used with XML. ENVELOPED adds the signature as a child of the root element while ENVELOPING wraps the XML in a new element. Only applies to XAdES signatures. Must be ENVELOPING when used without ASiC container and with non XML documents. For a document with xdcParameters.autoLoadEform=true, this value can be overridden by the resolved eForm requirements.

        ENVELOPED
        @enum {string}
      • Optionalprofile?: null | "BASELINE_B" | "BASELINE_T"

        Signature profile. If null, the BASELINE_B profile is used by default.

        BASELINE_B
        @enum {string}
      • OptionalpropertiesCanonicalization?:
            | null
            | "INCLUSIVE"
            | "EXCLUSIVE"
            | "INCLUSIVE_WITH_COMMENTS"
            | "EXCLUSIVE_WITH_COMMENTS"
            | "INCLUSIVE_11"
            | "INCLUSIVE_11_WITH_COMMENTS"

        Optional properties canonicalization method.

        INCLUSIVE
        @enum {string}
      • Optionalen319132?: boolean

        Optional flag to control whether the signature should be made according to ETSI EN 319132 for XAdES and ETSI EN 319122 for CAdES and PAdES.

        false
        
      • OptionalrequireQualifiedCertificate?: boolean

        Require the signing certificate to be qualified.

        false
        
    • Optionaloptions: DesktopSignOptions

    Returns Promise<SignedDocumentResult>