|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iaik.security.dsa.DSAParams
An implementation of DSA parameters that supports ASN.1 encoding. The Digital Signature Algorithm (DSA) only can be used for digital signing (respectively signature verifying). It cannot be used for data encryption.
NIST´s Digital Signature Standard (DSS) specifies the DSA algorithm as public-key algorithm for being used for digital signing applications. For first calculating a hash value of any data to be signed, the Secure Hash Algorithm is proposed to be used along with the DSA algorithm.
The DSA algorithm uses a certain number of parameters:
p
, which length is a multiple of 64 bits lying between
512 and 1024 bits
q
) of p-1
(h(p-1)/q)(mod p) > 1
g = (h(p-1)/q)(mod p)
x
less than q
y
calculated from y = (gx)(mod p)
This class represents the public parameters p
(prime), q
(sub-prime), and g
and, for instance, may be used for algorithm specific
initializing a KeyPairGenerator for generating DSA keys:
DSAParams dsa_params = new DSAParams(p, q, g); dsa_key_gen.initialize(dsa_params, random);
(See http://java.sun.com/products/JDK/1.1/docs/guide/security/CryptoSpec.html)
KeyPairGenerator
,
KeyPair
,
DSA
,
RawDSA
,
DSAPublicKey
,
DSAPrivateKey
,
DSAKeyPairGenerator
,
DSAKeyFactory
Constructor Summary | |
DSAParams(ASN1Object obj)
Creates a new DSAParams object from the given ASN.1 Object. |
|
DSAParams(BigInteger p,
BigInteger q,
BigInteger g)
Creates a new DSAParams object from the given BigInteger parameters. |
|
DSAParams(DSAParams params)
Creates a new DSAParams object from the given DSAParams |
Method Summary | |
boolean |
equals(Object obj)
Compares this DSAParams object with the given DSAParams object. |
BigInteger |
getG()
Returns the public base value g as BigInteger. |
BigInteger |
getP()
Returns the public prime value p as BigInteger. |
BigInteger |
getQ()
Returns the public sub-prime value q as BigInteger. |
int |
hashCode()
Returns a hash code for this DSAParams object. |
ASN1Object |
toASN1Object()
Returns this DSAParams object as ASN1Object of type SEQUENCE. |
String |
toString()
Returns a string that represents the contents of this DSAParams. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DSAParams(BigInteger p, BigInteger q, BigInteger g)
p
- the public prime p (of a multiple length of 64 bits between 512
and 1024 bits)q
- the public sub-prime q (a 160-bit prime factor of p-1)g
- the public base g (=(h(p-1)/q)(mod p) > 1, with h < p-1)public DSAParams(DSAParams params)
params
- the DSAParamspublic DSAParams(ASN1Object obj) throws CodingException
This constructor may be used for parsing an already exisiting
DSAParams
object, supplied as ASN1Object
that may have been created by calling toASN1Object
.
obj
- the DSA parameters as ASN1ObjectMethod Detail |
public BigInteger getP()
p
as BigInteger.getP
in interface DSAParams
public BigInteger getQ()
q
as BigInteger.getQ
in interface DSAParams
public BigInteger getG()
g
as BigInteger.getG
in interface DSAParams
public ASN1Object toASN1Object()
The ASN1Object returned by this method may be used as parameter value
when creating a DSAParams
object using the
DSAParams(ASN1Object obj)
constructor.
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
- the other DSAParams objecttrue
, if the two DSAParams objects are equal, false
otherwisepublic String toString()
toString
in class Object
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |