Client for simulating mobile app. Not used in extension or similar integrations

Constructors

Properties

_deleteDeviceIntegration: "/device-integrations/{integration_id}" = ...
_getDeviceIntegrations: "/device-integrations" = ...
_getDocumentSignatureParameters: "/documents/{guid}/parameters" = ...
_getDocumentVisualization: "/documents/{guid}/visualization" = ...
_postDevice: "/devices" = ...
_postDeviceIntegrations: "/device-integrations" = ...
_postDocumentDataToSign: "/documents/{guid}/datatosign" = ...
_postDocumentSign: "/documents/{guid}/sign" = ...
baseUrl: string
log: Logger = ...

Methods

  • Device-side unpairing: removes the integration from this device.

    Parameters

    • integrationId: string
    • bearerToken: string

    Returns Promise<void>

  • Parameters

    • bearerToken: string

    Returns Promise<{ displayName: string; integrationId: string; platform: string }[]>

  • Called by mobile app to retrieve signing configuration (level, timestamp, etc.) for the document.

    Parameters

    • params: { guid: string }
      • guid: string
        bfde97b4-ee27-47bc-97e2-5164ed96a92a
        
    • documentEncryptionKey: string

    Returns Promise<
        {
            autoLoadEform?: boolean;
            checkPDFACompliance?: boolean;
            container?: "ASiC-E"
            | "ASiC-S";
            containerXmlns?: "http://data.gov.sk/def/container/xmldatacontainer+xml/1.1";
            digestAlgorithm?: "SHA256" | "SHA384" | "SHA512";
            embedUsedSchemas?: boolean;
            en319132?: boolean;
            identifier?: string;
            infoCanonicalization?:
                | "INCLUSIVE"
                | "EXCLUSIVE"
                | "INCLUSIVE_WITH_COMMENTS"
                | "EXCLUSIVE_WITH_COMMENTS"
                | "INCLUSIVE_11"
                | "INCLUSIVE_11_WITH_COMMENTS";
            keyInfoCanonicalization?: | "INCLUSIVE"
            | "EXCLUSIVE"
            | "INCLUSIVE_WITH_COMMENTS"
            | "EXCLUSIVE_WITH_COMMENTS"
            | "INCLUSIVE_11"
            | "INCLUSIVE_11_WITH_COMMENTS";
            level?: | "XAdES_BASELINE_B"
            | "PAdES_BASELINE_B"
            | "CAdES_BASELINE_B"
            | "XAdES_BASELINE_T"
            | "PAdES_BASELINE_T"
            | "CAdES_BASELINE_T";
            packaging?: "ENVELOPED"
            | "ENVELOPING";
            propertiesCanonicalization?:
                | "INCLUSIVE"
                | "EXCLUSIVE"
                | "INCLUSIVE_WITH_COMMENTS"
                | "EXCLUSIVE_WITH_COMMENTS"
                | "INCLUSIVE_11"
                | "INCLUSIVE_11_WITH_COMMENTS";
            schema?: string;
            schemaIdentifier?: string;
            transformation?: string;
            transformationIdentifier?: string;
            transformationLanguage?: string;
            transformationMediaDestinationTypeDescription?: "XHTML"
            | "HTML"
            | "TXT";
            transformationTargetEnvironment?: string;
        },
    >

  • Called by mobile app after scanning QR code to display document to user for preview.

    Parameters

    • params: { guid: string }
      • guid: string
        bfde97b4-ee27-47bc-97e2-5164ed96a92a
        
    • documentEncryptionKey: string

    Returns Promise<{ content: string; filename?: string; mimeType: string }>

  • Parameters

    • data: {
          displayName: string;
          platform: string;
          publicKey: string;
          pushkey: string;
          registrationId: string;
      }
      • displayName: string

        Human-readable name of the device

        John's phone
        
      • platform: string

        Platform of the signing device used to determine which notification service to use. (android or ios)

        android
        
      • publicKey: string

        Device's ES256 public key that shall be used to authenticate its JWT tokens. Either with or without "-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----".

        -----BEGIN PUBLIC KEY-----
        MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1iPVm0v/ZNM04587g10F54JVIrMZqWnlOXuGjOvcYsuweTYxuXafP8aJ6kIXe+jQhjeldm2mQZzSZ4ceLRq0yA==
        -----END PUBLIC KEY-----
      • pushkey: string

        Device's AES256 key in Base64 form that shall be used to encrypt notificaiton messages sent to the device

        R/rfN+z129w1H2iftbr1GOKXdC3OxSJU9PZeHs+W7ts=
        
      • registrationId: string

        Identifier of the app instance registration entry in the notification service (APNS or GCM)

        idk32b83ef7-21fe-4120-b8fa-d9f6aba05731
        

    Returns Promise<{ guid?: string }>

  • Parameters

    • data: { integrationPairingToken: string }
      • integrationPairingToken: string

        JWT token provided by integration on pairing. The token must contain aud: "device" claim.

        eyJhbGciOiJFUzI1NiJ9.eyJzdWIiOiI3OGQ5MWRlNy0xY2MyLTQwZTQtOWE3MS0zODU4YjRmMDMxOWQiLCJleHAiOjE3MTI5MDk3MjAsImp0aSI6IjAwZTAxN2Y1LTI4MTAtNDkyNS04ODRlLWNiN2FhZDAzZDFhNiIsImF1ZCI6ImRldmljZSJ9.7Op6W2BvbX2_mgj9dkz1IiolEsQ1Z2a0AzpS5bj4pcG3CJ4Z8j9W3RQE95wrAj3t6nmd9JaGZSlCJNSV_myyLQ
        
    • bearerToken: string

    Returns Promise<void>

  • Called by mobile app to send signing certificate and get the data that needs to be signed (DataToSign). Pre-condition: User selected certificate.

    Parameters

    • params: { guid: string }
      • guid: string
        bfde97b4-ee27-47bc-97e2-5164ed96a92a
        
    • data: { addTimestamp?: boolean; signingCertificate: string }
      • OptionaladdTimestamp?: boolean

        Indication whether to add a timestamp to the signature if it was not set at document creation time

        false
        
        true
        
      • signingCertificate: string
    • documentEncryptionKey: string

    Returns Promise<{ dataToSign: string; signingCertificate: string; signingTime: number }>

  • Called by mobile app as final step: send locally-signed data. Server combines with document and completes signing. Pre-condition: User signed the DataToSign.

    Parameters

    • params: { guid: string }
      • guid: string
        bfde97b4-ee27-47bc-97e2-5164ed96a92a
        
    • data: {
          dataToSignStructure: {
              dataToSign: string;
              signingCertificate: string;
              signingTime: number;
          };
          signedData: string;
      }
      • dataToSignStructure: { dataToSign: string; signingCertificate: string; signingTime: number }

        The original DataToSignStructre to compare it with DataToSignStructure generated in this request to verify consistency

      • signedData: string

        DataToSign signed by SigningCertificate

        eP49QHaKINDTo8/56O6ZlDVKGn3FYq+fRqnCMpQExYVIWrHeZkGoq2FxRRThlEKkOBUS5+8+RHZzOf4yXAFfKjNmNdMnyisEUToQqYSQavec3KZPaDgcvNdZ4MC+tRMcwTod75Zu87UleyOLe3Xoqxjteq7MvqVRCc/C1sX2yVab3yIOSgoZILpHgTl4EqTOonVJts4XBnEzuZKwXS10KyumjoSE41EqTrM/mwy95ebdrRZqNI5EWJIzor8jC5AMsmsBWvxeBKkfepFiWHMtTy1iYkJMZ6vbttlEdTSt9OqSszyw7Z7fP7Tl55hkKL4fiiXA9DOzyibn4E1XD1tRPRaqulxsdIrTbnMgeXlteXG3XXK76+OgqnRxb2hxPx6H8Qiig0GhK1Qn2H26JaNrpFjsqT9n7md9PzLuhmB4MI7HxOUCdAxmRt4cxNkJdHB2NsDBVfQ7FBNxxi35j93D/GD2KpaG77Iq/5ZfBegvQn28N2oGh/xsEqc3hoc6o23E
        
    • documentEncryptionKey: string

    Returns Promise<
        {
            content: string;
            filename: string;
            issuedBy: string;
            mimeType: string;
            signedBy: string;
        },
    >