Oracle Security Developer Tools Crypto Java API Reference
10g (10.1.4.0.1)

B28171-01


oracle.security.crypto.core
Class DSAParams

java.lang.Object
  extended byoracle.security.crypto.core.DSAParams

All Implemented Interfaces:
ASN1Object, Streamable

public class DSAParams
extends java.lang.Object
implements ASN1Object

Parameters used for the Digital Signature Standard, as described in FIPS 186. The parameter names used here match that reference.

The necessary parameters to implement DSA are:

The following ASN.1 encoding is used, defined in the PKIX draft standard:

                Dss-Parms  ::=  SEQUENCE  {
                        p                        INTEGER,
                        q                        INTEGER,
                        g                        INTEGER  }
        

A DSAParams may also store the seed and counter used to generate p and q.

Warning: The serialization capability of this class should only be used for short-term storage and RMI between applications running the same version of this product. It should not be relied on for long-term perisistence, as future versions of this class may use an incompatible serialization format. For now, applications requiring long-term persistence should use the ASN.1 encodings provided by the input(InputStream) and output(OutputStream) methods directly, instead of serialization.


Constructor Summary
DSAParams()
          Creates a new, noninitialized DSAParams object.
DSAParams(ASN1Sequence s)
          Creates a new DSAParams object by parsing the given ASN.1 sequence.
DSAParams(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g)
          Creates a new DSAParams object with the given values of p, q, and g.
DSAParams(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, byte[] seed, int counter)
          Creates a new DSAParams object with the given values of p, q, g, seed and counter.
DSAParams(java.io.InputStream is)
          Creates a new DSAParams object by reading its encoding from the given input stream.

 

Method Summary
 int getCounter()
          Get the counter that was used generate these parameters.
 java.math.BigInteger getG()
          Gets g.
 java.math.BigInteger getP()
          Gets p.
 java.math.BigInteger getQ()
          Gets q.
 byte[] getSeed()
          Gets the seed that was used generate these parameters.
 void input(ASN1Sequence s)
          parses a DSAParams object from given ASN1Sequence.
 void input(java.io.InputStream is)
          reads the encoding of a DSAParams object from given InputStream.
 int length()
          Returns the length of this object's encoding.
 void output(java.io.OutputStream os)
          Outputs the encoding of this DSAParams object to the given OutputStream.
 ASN1Sequence outputASN1()
          Outputs this DSAParams object to the given ASN1Sequence.
 java.lang.String toString()
          Transforms this DSAParams object into a readable string.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

DSAParams

public DSAParams()
Creates a new, noninitialized DSAParams object.

DSAParams

public DSAParams(java.math.BigInteger p,
                 java.math.BigInteger q,
                 java.math.BigInteger g)
Creates a new DSAParams object with the given values of p, q, and g. The seed and counter used to generate p and q are not stored.
Parameters:
p - the large prime p
q - the small prime q
g - the generator g

DSAParams

public DSAParams(java.math.BigInteger p,
                 java.math.BigInteger q,
                 java.math.BigInteger g,
                 byte[] seed,
                 int counter)
Creates a new DSAParams object with the given values of p, q, g, seed and counter.
Parameters:
p - the large prime p
q - the small prime q
g - the generator g
seed - the seed used to generate p and q.
counter - the counter used to generate p and q.

DSAParams

public DSAParams(java.io.InputStream is)
          throws java.io.IOException
Creates a new DSAParams object by reading its encoding from the given input stream.
Parameters:
is - the inputStream where the DSAParam comes from
Throws:
java.io.IOException - If an input exception occured.

DSAParams

public DSAParams(ASN1Sequence s)
          throws java.io.IOException
Creates a new DSAParams object by parsing the given ASN.1 sequence.
Parameters:
s - the ASN1Sequence representing the DSAParams.
Throws:
java.io.IOException - If an input exception occured.

Method Detail

getP

public java.math.BigInteger getP()
Gets p.
Returns:
the large prime p; or null if p is not initialized

getQ

public java.math.BigInteger getQ()
Gets q.
Returns:
the small prime q; or null if q is not initialized

getG

public java.math.BigInteger getG()
Gets g.
Returns:
the generator g; or null if g is not initialized

getSeed

public byte[] getSeed()
Gets the seed that was used generate these parameters. The seed is not saved or restored on I/O, so it will only be set in an object output by DSAKeyPairGenerator.generateParameters().
Returns:
the seed used to generate p and q; or null if seed is not initialized

getCounter

public int getCounter()
Get the counter that was used generate these parameters. The counter is not saved or restored on I/O, so it will only be set in an object output by DSAKeyPairGenerator.generateParameters().
Returns:
the count used to generate p and q. or null if the count is not initialized

input

public void input(java.io.InputStream is)
           throws java.io.IOException
reads the encoding of a DSAParams object from given InputStream.
Specified by:
input in interface Streamable
Parameters:
is - the inputStream where the DSAParam comes from
Throws:
java.io.IOException - If an input exception occured.
See Also:
output(java.io.OutputStream)

input

public void input(ASN1Sequence s)
           throws java.io.IOException
parses a DSAParams object from given ASN1Sequence.
Parameters:
s - the ASN1Sequence representing the DSAParams.
Throws:
java.io.IOException - If an input exception occured.
See Also:
outputASN1()

output

public void output(java.io.OutputStream os)
            throws java.io.IOException
Outputs the encoding of this DSAParams object to the given OutputStream.
Specified by:
output in interface Streamable
Parameters:
os - the OutputStream where this DSAParams will go
Throws:
java.io.IOException - If an output exception occured.
See Also:
input(InputStream)

outputASN1

public ASN1Sequence outputASN1()
Outputs this DSAParams object to the given ASN1Sequence.
Returns:
the ASN1Sequence representing this DSAParams will go
See Also:
input(ASN1Sequence)

length

public int length()
Returns the length of this object's encoding.
Specified by:
length in interface Streamable
Returns:
the length of this object's encoding.

toString

public java.lang.String toString()
Transforms this DSAParams object into a readable string.
Returns:
a string in readable form representing this DSAParams object

Oracle Security Developer Tools Crypto Java API Reference
10g (10.1.4.0.1)

B28171-01


Copyright © 2005 ,2006 , Oracle. All rights reserved.