EntitySign

Hierarchy

Properties

Readonly __createdAt

__createdAt: TDatetime

Date and time of creation.

Readonly __createdBy

__createdBy: UserItemRef

Object’s author.

Optional Readonly __deletedAt

__deletedAt: TDatetime

Date and time of deletion.

Readonly __id

__id: string

ID of the object.

__name

__name: TString

Name of the object.

Readonly __updatedAt

__updatedAt: TDatetime

Date and time of change.

Readonly __updatedBy

__updatedBy: UserItemRef

Author of the last change.

activationLink

activationLink: string

Link to activate the certificate.

body

body: string

Signed data.

The field stores the signature’s body in the base24 format. If a file was signed, the field stores the ID of the file’s body, not the content.

cert

cert: string

Public key of the digital signature in the base24 format.

comment

comment: string

Comment to the signature.

content

content: SignedContent

Signed data.

createdAt

createdAt: string

Date of creation.

hash

hash: string

Hash calculated for the signed content.

Hash used to determine which file version was signed.

id

id: string

ID of the signature.

lastSyncTime

lastSyncTime: TDatetime

Date and time of the last synchronization of the signing status with the digital signature provider.

operationStatus

operationStatus: EntitySignOperationStatus

Document signing operation status.

phone

phone: PhoneField

Phone number specified if signing is confirmed by phone.

provider

provider: SignProvider

Digital signature provider used for signing data.

sign

sign: string

Content of the calculated signature.

The field stores the signature’s body in the base64 format.

status

status: SignStatus

Signature status.

statusMessage

statusMessage: string

Message specifying the signature’s status.

The fields stores the comment to the current status of the signature.

type

type: SignType

Type of the calculated signature.

userID

userID: string

ID of the user who signed the item.

validUntilAt

validUntilAt: TDatetime

Date and time until which the certificate can be used to sign documents.

Methods

createAttributesFile

  • createAttributesFile(): Promise<FileItem | undefined>
  • obsolete

    Use methods in EntitySignItem. The method generates a file from the signed app item attributes. It returns the values of the signed attributes as a file. The example shows how to extract all attribute signatures of an app item:

    // The signature's ID is stored in the context  
    const signId = Context.data.signId; 
    if (!signId) { 
        throw new Error( 'Signature ID not found'); 
    } 
    // Search for the signature by ID 
    const sign  = await System.signs.entitySigns.search().where(q => q.__id.eq(signId)). first(); 
    if(!sign) { 
        throw new Error('Signature not found'); 
    } 
    //  Signature files request 
    const awaitSigns = sign.signs.map(signData =>  signData.createAttributesFile()); 
    // Wait for the requests to finish  
    Context.data.signFiles = await Promise.all(awaitSigns); 
    

    Returns Promise<FileItem | undefined>

    File with the attributes of an app item that have been signed.

createSignFile

  • obsolete

    Use methods in EntitySignItem. The method generates a file with a signature. It is used to get a signature’s body as a file. The example shows how to extract all file signatures of an app item:

    //  The signature's ID is stored in the context  
    const signId = Context.data. signId; 
    if (!signId) { 
        throw new Error('Signature ID not found'); 
    }  
    // Search for the signature by ID 
    const sign = await System.signs. entitySigns.search().where(q => q.__id.eq(signId)).first(); 
    if(!sign) {  
        throw new Error('Signature not found'); 
    } 
    // Request signature files  
    const awaitSigns = sign.signs.map(signData => signData.createSignFile());  
    // Wait for the requests to finish 
    Context.data.signFiles = await Promise. all(awaitSigns); 
    

    Returns Promise<FileItem>

    File with the signature.

getDetails

  • obsolete

    Use methods in EntitySignItem. This method returns detailed information about the signature and the public key that was used to create it. The following information is extracted from the public key: attributes of the issuer and the owner, validity dates, and the public key’s name and serial number. The attributes are named according to RFC 2253, however, attributes that are not among standard CertNames fields are not encoded as hex. In the example, detailed information about a signature is extracted to save the certificate’s serial number to the process context:

    // The  signature’s ID is stored in the context 
    const signId = Context.data.signId;  
    if (!signId) { 
        throw new Error('Signature ID not found'); 
    } 
    //  Search for the signature by ID 
    const sign = await System.signs.entitySigns. search().where(q => q.__id.eq(signId)).first(); 
    if(!sign) { 
        throw new  Error('Signature not found'); 
    } 
    // Extracting the most recent signature  from the history 
    const lastSign = sign.signs[0]; 
    if (!lastSign) { 
         throw new Error('Signature needed to extract the data'); 
    } 
    // Extract the  detailed information 
    const signDetails = await lastSign.getDetails(); 
    //  Save the serial number of the certificate to the context  
    Context.data.certificateId = signDetails.certSerialNumber; 
    

    Returns Promise<SignDetails>