DSAKeyPairGenerator (Java SE 9 & JDK 9 ) (original) (raw)

public interface DSAKeyPairGenerator
An interface to an object capable of generating DSA key pairs.
The initialize methods may each be called any number of times. If no initialize method is called on a DSAKeyPairGenerator, the default is to generate 1024-bit keys, using precomputed p, q and g parameters and an instance of SecureRandom as the random bit source.
Users wishing to indicate DSA-specific parameters, and to generate a key pair suitable for use with the DSA algorithm typically

  1. Get a key pair generator for the DSA algorithm by calling the KeyPairGenerator getInstance method with "DSA" as its argument.
  2. Initialize the generator by casting the result to a DSAKeyPairGenerator and calling one of theinitialize methods from this DSAKeyPairGenerator interface.
  3. Generate a key pair by calling the generateKeyPair method from the KeyPairGenerator class.
    Note: it is not always necessary to do algorithm-specific initialization for a DSA key pair generator. That is, it is not always necessary to call an initialize method in this interface. Algorithm-independent initialization using the initialize method in the KeyPairGenerator interface is all that is needed when you accept defaults for algorithm-specific parameters.
    Note: Some earlier implementations of this interface may not support larger sizes of DSA parameters such as 2048 and 3072-bit.
    Since:
    1.1
    See Also:
    KeyPairGenerator

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2017, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.