MIRACL Trust DVS JS

DVS

Constructor Parameters

  • options Object
    • options.userId string ID of the currently logged in user
    • options.server string Server address
    • options.clientId string Client ID for the registered platform application
    • options.redirectURI string Redirect URI for the registered platform application
    • options.pinPolicy string Whether to use the same PIN as for authentication
    • options.documentTpl string Template for displaying the document to be signed. Has access to the properties of the object returned by parseDocument
    • options.parseDocument function Prepare document data for the document template
    • options.defaultPinMessage string Default message for the PIN input

init

Initialize and set up communication for signing

Parameters

  • callback function () Called after initialization

sign

Sign a document

Parameters

  • documentData Object
    • documentData.doc string
    • documentData.hash string
    • documentData.timestamp string
  • successCb function (Signature) Called after successful signature creation
  • errorCb function (Error) Called if an error occurs

hasIdentity

Check if there is an identity for the user ID

Parameters

  • successCb function (Object) Called if there already is an identity
  • errorCb function (Error) Called if there isn’t a created identity

createIdentity

Create a signing identity

Parameters

  • successCb function (Object) Called after successful creation of the identity
  • errorCb function (Error) Called if an error occurs

deleteIdentity

Delete the current signing identity

Parameters

  • successCb function (Object) Called after successful deletion of the identity
  • errorCb function (Error) Called if an error occurs

Signature

Type: Object

Properties

  • Hash string Hash of the signed document
  • MpinId string M-Pin ID used to generate the signature
  • U string The random commitment generated by the user
  • V string The proof of the signature
  • PublicKey string User’s public key used in the key-escrowless scheme