home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / security / spec / DSAPrivateKeySpec.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  2.0 KB  |  97 lines

  1. /*
  2.  * @(#)DSAPrivateKeySpec.java    1.9 98/03/18
  3.  *
  4.  * Copyright 1997 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.security.spec;
  16.  
  17. import java.math.BigInteger;
  18.  
  19. /**
  20.  * This class specifies a DSA private key with its associated parameters.
  21.  *
  22.  * @author Jan Luehe
  23.  *
  24.  * @version 1.9, 98/03/18
  25.  *
  26.  * @see java.security.Key
  27.  * @see java.security.KeyFactory
  28.  * @see KeySpec
  29.  * @see DSAPublicKeySpec
  30.  * @see PKCS8EncodedKeySpec
  31.  *
  32.  * @since JDK1.2
  33.  */
  34.  
  35. public class DSAPrivateKeySpec implements KeySpec {
  36.  
  37.     private BigInteger x;
  38.     private BigInteger p;
  39.     private BigInteger q;
  40.     private BigInteger g;
  41.  
  42.     /**
  43.      * Creates a new DSAPrivateKeySpec with the specified parameter values.
  44.      * 
  45.      * @param x the private key.
  46.      * 
  47.      * @param p the prime.
  48.      * 
  49.      * @param q the sub-prime.
  50.      * 
  51.      * @param g the base.
  52.      */
  53.     public DSAPrivateKeySpec(BigInteger x, BigInteger p, BigInteger q,
  54.                  BigInteger g) {
  55.     this.x = x;
  56.     this.p = p;
  57.     this.q = q;
  58.     this.g = g;
  59.     }
  60.  
  61.     /**
  62.      * Returns the private key <code>x</code>.
  63.      *
  64.      * @return the private key <code>x</code>.
  65.      */
  66.     public BigInteger getX() {
  67.     return this.x;
  68.     }
  69.  
  70.     /**
  71.      * Returns the prime <code>p</code>.
  72.      *
  73.      * @return the prime <code>p</code>.
  74.      */
  75.     public BigInteger getP() {
  76.     return this.p;
  77.     }
  78.  
  79.     /**
  80.      * Returns the sub-prime <code>q</code>.
  81.      *
  82.      * @return the sub-prime <code>q</code>.
  83.      */
  84.     public BigInteger getQ() {
  85.     return this.q;
  86.     }
  87.  
  88.     /**
  89.      * Returns the base <code>g</code>.
  90.      *
  91.      * @return the base <code>g</code>.
  92.      */
  93.     public BigInteger getG() {
  94.     return this.g;
  95.     }
  96. }
  97.