Command line script - cryptography operations (mostly for UA) Usage (shut down server before usage): ubcli crypt --help

Methods

# buildFullPath (fnstring) → string inner

For relative path transform it to absolute relative to cwd

Arguments:

# certParse (certOrFolderPathstring) inner

Parse certificate(s)

Arguments:

# combine (dataFnstring, signatureFnstring) inner

Combine data and signature(s) into one container

Arguments:

# ensueFolder (folderPathstring) → string inner

Create absolute folder path and force to create it

Return:

absolute folder path

Arguments:

# enumDev () inner

Display JSON with available key medias and devices

# hash (dataFnstring, algooptstring) inner

Arguments:

# showUsage () inner

Display usage

# sign (fileName4Signstring, signFormatstring) inner

Create detached signature for file. [-k privateKeyPath] [-p privateKeyPwd | -i] [-o signatureFn] [-kn additionalKeyName]

  • if "-k privateKeyPath" is not specified - use key from "ubConfig.security.dstu.iit.keyPath"
  • if "-p privateKeyPwd" is not specified - use password from "ubConfig.security.dstu.iit.password",
  • "-i" is specified - ask for password form stdin
  • "signFormat" can be one of "CAdES", "XAdES"
  • "-o signatureFn" is a result file name, if not specified - output result to stdin

Arguments:
  • fileName4Sign: string
  • signFormat: string

    one of "CAdES", "XAdES"

# signAsic (fileName4Signstring, signFormatstring) inner

Create ASiC-E-signFormat (ASiC-E-CAdES or ASiC-E-XAdES) container for file(s) (; separated).

  • if "-k privateKeyPath" is not specified - use key from "ubConfig.security.dstu.iit.keyPath"
  • if "-p privateKeyPwd" is not specified - use password from "ubConfig.security.dstu.iit.password",
  • "-i" is specified - ask for password form stdin
  • "signFormat" can be one of "CAdES", "XAdES"
  • "-o signatureFn" is a result file name, if not specified - output result to first fileName4Sign folder in firstFileName4Sign.asice

Arguments:
  • fileName4Sign: string
  • signFormat: string

    one of "CAdES", "XAdES"

# split (containerFnstring, destFolderstring) inner

Split any container (with one data file) into data file and signatures

Arguments:
  • containerFn: string

    Container file name

  • destFolder: string

    Destination folder for extraction

# verify (signFnstring, dataFnoptstring) inner

Verify signature

Arguments: