Class Index | File Index

Classes


Class KJUR.crypto.DSA

class for DSA signing and verifcation
Defined in: dsa-2.0.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
class for DSA signing and verification

CAUTION: Most of the case, you don't need to use this class.

Method Summary
Method Attributes Method Name and Description
 
parse hexadecimal ASN.1 DSA signature value
 
setPrivate(p, q, g, y, x)
set DSA private key by key parameters
 
setPublic(p, q, g, y)
set DSA public key by key parameters
 
sign to hashed message by this DSA private key object
 
verifyWithMessageHash(sHashHex, hSigVal)
verify signature by this DSA public key object
Class Detail
KJUR.crypto.DSA()
class for DSA signing and verification

CAUTION: Most of the case, you don't need to use this class. Please use KJUR.crypto.Signature class instead.

NOTE: Until jsrsasign 6.2.3, DSA class have used codes from openpgpjs library 1.0.0 licenced under LGPL licence. To avoid license issue dsa-2.0.js was re-written with my own codes in jsrsasign 7.0.0. Some random number generators used in dsa-2.0.js was newly defined in KJUR.crypto.Util class. Now all of LGPL codes are removed.

Since:
jsrsasign 7.0.0 dsa 2.0.0
Method Detail
{Array} parseASN1Signature(hSigVal)
parse hexadecimal ASN.1 DSA signature value
Parameters:
{String} hSigVal
hexadecimal string of ASN.1 encoded DSA signature value
Since:
jsrsasign 7.0.0 dsa 2.0.0
Returns:
{Array} array [r, s] of DSA signature value. Both r and s are BigInteger.

setPrivate(p, q, g, y, x)
set DSA private key by key parameters
Parameters:
{BigInteger} p
prime P
{BigInteger} q
sub prime Q
{BigInteger} g
base G
{BigInteger} y
public key Y
{BigInteger} x
private key X
Since:
jsrsasign 7.0.0 dsa 2.0.0

setPublic(p, q, g, y)
set DSA public key by key parameters
Parameters:
{BigInteger} p
prime P
{BigInteger} q
sub prime Q
{BigInteger} g
base G
{BigInteger} y
public key Y
Since:
jsrsasign 7.0.0 dsa 2.0.0

{String} signWithMessageHash(sHashHex)
sign to hashed message by this DSA private key object
Parameters:
{String} sHashHex
hexadecimal string of hashed message
Since:
jsrsasign 7.0.0 dsa 2.0.0
Returns:
{String} hexadecimal string of ASN.1 encoded DSA signature value

{Boolean} verifyWithMessageHash(sHashHex, hSigVal)
verify signature by this DSA public key object
Parameters:
{String} sHashHex
hexadecimal string of hashed message
{String} hSigVal
hexadecimal string of ASN.1 encoded DSA signature value
Since:
jsrsasign 7.0.0 dsa 2.0.0
Returns:
{Boolean} true if the signature is valid otherwise false.

© 2012-2016 Kenji Urushima, All rights reserved
Documentation generated by JsDoc Toolkit 2.4.0