Class KJUR.crypto.Util
static object for cryptographic function utilities
Defined in: crypto-1.1.js.
Constructor Attributes | Constructor Name and Description |
---|---|
static object for cryptographic function utilities
|
Field Attributes | Field Name and Description |
---|---|
associative array of default provider name for each hash and signature algorithms
|
|
PKCS#1 DigestInfo heading hexadecimal bytes for each hash algorithms
|
Method Attributes | Method Name and Description |
---|---|
<static> |
KJUR.crypto.Util.getDigestInfoHex(hHash, alg)
get hexadecimal DigestInfo
|
<static> |
KJUR.crypto.Util.getPaddedDigestInfoHex(hHash, alg, keySize)
get PKCS#1 padded hexadecimal DigestInfo
|
<static> |
KJUR.crypto.Util.hashHex(sHex, alg)
get hexadecimal hash of hexadecimal string with specified algorithm
|
<static> |
KJUR.crypto.Util.hashString(s, alg)
get hexadecimal hash of string with specified algorithm
|
<static> |
KJUR.crypto.Util.md5(s)
get hexadecimal MD5 hash of string
|
<static> |
KJUR.crypto.Util.ripemd160(s)
get hexadecimal RIPEMD160 hash of string
|
<static> |
KJUR.crypto.Util.sha1(s)
get hexadecimal SHA1 hash of string
|
<static> |
KJUR.crypto.Util.sha256(s)
get hexadecimal SHA256 hash of string
|
<static> |
KJUR.crypto.Util.sha512(s)
get hexadecimal SHA512 hash of string
|
Field Detail
{Array}
DEFAULTPROVIDER
associative array of default provider name for each hash and signature algorithms
{Array}
DIGESTINFOHEAD
PKCS#1 DigestInfo heading hexadecimal bytes for each hash algorithms
Method Detail
<static>
{String}
KJUR.crypto.Util.getDigestInfoHex(hHash, alg)
get hexadecimal DigestInfo
- Parameters:
- {String} hHash
- hexadecimal hash value
- {String} alg
- hash algorithm name (ex. 'sha1')
- Returns:
- {String} hexadecimal string DigestInfo ASN.1 structure
<static>
{String}
KJUR.crypto.Util.getPaddedDigestInfoHex(hHash, alg, keySize)
get PKCS#1 padded hexadecimal DigestInfo
- Parameters:
- {String} hHash
- hexadecimal hash value of message to be signed
- {String} alg
- hash algorithm name (ex. 'sha1')
- {Integer} keySize
- key bit length (ex. 1024)
- Returns:
- {String} hexadecimal string of PKCS#1 padded DigestInfo
<static>
{String}
KJUR.crypto.Util.hashHex(sHex, alg)
get hexadecimal hash of hexadecimal string with specified algorithm
- Parameters:
- {String} sHex
- input hexadecimal string to be hashed
- {String} alg
- hash algorithm name
- Since:
- 1.1.1
- Returns:
- {String} hexadecimal string of hash value
<static>
{String}
KJUR.crypto.Util.hashString(s, alg)
get hexadecimal hash of string with specified algorithm
- Parameters:
- {String} s
- input string to be hashed
- {String} alg
- hash algorithm name
- Since:
- 1.1.1
- Returns:
- {String} hexadecimal string of hash value
<static>
{String}
KJUR.crypto.Util.md5(s)
get hexadecimal MD5 hash of string
- Parameters:
- {String} s
- input string to be hashed
- Since:
- 1.0.3
- Returns:
- {String} hexadecimal string of hash value
<static>
{String}
KJUR.crypto.Util.ripemd160(s)
get hexadecimal RIPEMD160 hash of string
- Parameters:
- {String} s
- input string to be hashed
- Since:
- 1.0.3
- Returns:
- {String} hexadecimal string of hash value
<static>
{String}
KJUR.crypto.Util.sha1(s)
get hexadecimal SHA1 hash of string
- Parameters:
- {String} s
- input string to be hashed
- Since:
- 1.0.3
- Returns:
- {String} hexadecimal string of hash value
<static>
{String}
KJUR.crypto.Util.sha256(s)
get hexadecimal SHA256 hash of string
- Parameters:
- {String} s
- input string to be hashed
- Since:
- 1.0.3
- Returns:
- {String} hexadecimal string of hash value
<static>
{String}
KJUR.crypto.Util.sha512(s)
get hexadecimal SHA512 hash of string
- Parameters:
- {String} s
- input string to be hashed
- Since:
- 1.0.3
- Returns:
- {String} hexadecimal string of hash value