Class: DigitalSignature

DigitalSignature(dataToSign) → {DigitalSignature}

new DigitalSignature(dataToSign) → {DigitalSignature}

Crypto signs methods
Parameters:
Name Type Description
dataToSign string Optional: data for sign
Source:
Returns:
Type
DigitalSignature

Members

keysPair

RSA keys for sign
Source:

sign

Sign
Source:

signedData

Data format as presented in 'block data'
Source:

Methods

generate(len)

Generate pair of keys for signing
Parameters:
Name Type Description
len number Length of the key
Source:

signData(data, key) → {Object}

Sign data
Parameters:
Name Type Description
data string Data
key string Private key
Source:
Returns:
Data - signable data, sign - Sign
Type
Object

verifyData(data, sign, key)

Signs data
Parameters:
Name Type Description
data string Signed data for verify
sign string Sign
key string Public key
Source:

(inner) fix(str) → {string}

PEM key fixing
Parameters:
Name Type Description
str
Source:
Returns:
Type
string

(inner) repairKey(key) → {string}

Repair bad generated key
Parameters:
Name Type Description
key
Source:
Returns:
Type
string