001: /*
002: * @(#)DSAPrivateKeySpec.java 1.21 06/10/10
003: *
004: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
005: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License version
009: * 2 only, as published by the Free Software Foundation.
010: *
011: * This program is distributed in the hope that it will be useful, but
012: * WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * General Public License version 2 for more details (a copy is
015: * included at /legal/license.txt).
016: *
017: * You should have received a copy of the GNU General Public License
018: * version 2 along with this work; if not, write to the Free Software
019: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA
021: *
022: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023: * Clara, CA 95054 or visit www.sun.com if you need additional
024: * information or have any questions.
025: *
026: */
027:
028: package java.security.spec;
029:
030: import java.math.BigInteger;
031:
032: /**
033: * This class specifies a DSA private key with its associated parameters.
034: *
035: * @author Jan Luehe
036: *
037: * @version 1.15, 02/02/00
038: *
039: * @see java.security.Key
040: * @see java.security.KeyFactory
041: * @see KeySpec
042: * @see DSAPublicKeySpec
043: * @see PKCS8EncodedKeySpec
044: *
045: * @since 1.2
046: */
047:
048: public class DSAPrivateKeySpec implements KeySpec {
049:
050: private BigInteger x;
051: private BigInteger p;
052: private BigInteger q;
053: private BigInteger g;
054:
055: /**
056: * Creates a new DSAPrivateKeySpec with the specified parameter values.
057: *
058: * @param x the private key.
059: *
060: * @param p the prime.
061: *
062: * @param q the sub-prime.
063: *
064: * @param g the base.
065: */
066: public DSAPrivateKeySpec(BigInteger x, BigInteger p, BigInteger q,
067: BigInteger g) {
068: this .x = x;
069: this .p = p;
070: this .q = q;
071: this .g = g;
072: }
073:
074: /**
075: * Returns the private key <code>x</code>.
076: *
077: * @return the private key <code>x</code>.
078: */
079: public BigInteger getX() {
080: return this .x;
081: }
082:
083: /**
084: * Returns the prime <code>p</code>.
085: *
086: * @return the prime <code>p</code>.
087: */
088: public BigInteger getP() {
089: return this .p;
090: }
091:
092: /**
093: * Returns the sub-prime <code>q</code>.
094: *
095: * @return the sub-prime <code>q</code>.
096: */
097: public BigInteger getQ() {
098: return this .q;
099: }
100:
101: /**
102: * Returns the base <code>g</code>.
103: *
104: * @return the base <code>g</code>.
105: */
106: public BigInteger getG() {
107: return this.g;
108: }
109: }
|