IPWorks Encrypt 2020 Node.js Edition

Questions / Feedback?

HashAlgorithm Property

The hash algorithm used for signing and signature verification.

Syntax

 rsa.getHashAlgorithm([callback])
 rsa.setHashAlgorithm( hashAlgorithm, [callback])

Possible Values

  0 (rhaSHA1), 
  1 (rhaSHA224), 
  2 (rhaSHA256), 
  3 (rhaSHA384), 
  4 (rhaSHA512), 
  5 (rhaRIPEMD160), 
  6 (rhaMD2), 
  7 (rhaMD5), 
  8 (rhaMD5SHA1)

Default Value

2

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for the getHashAlgorithm([callback]) method is defined as:

function(err, data){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'data' is the value returned by the method.

The callback for the setHashAlgorithm([callback]) method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This property specifies the hash algorithm used for signing and signature verification. Possible values are:

0 (rhaSHA1) SHA-1
1 (rhaSHA224) SHA-224
2 (rhaSHA256 - default) SHA-256
3 (rhaSHA384) SHA-384
4 (rhaSHA512) SHA-512
5 (rhaRIPEMD160) RIPEMD-160
6 (rhaMD2) MD2
7 (rhaMD5) MD5
8 (rhaMD5SHA1) MD5SHA1

Data Type

Integer

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Encrypt 2020 Node.js Edition - Version 20.0 [Build 8155]