KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > security > spec > DSAPublicKeySpec


1 /*
2  * @(#)DSAPublicKeySpec.java 1.18 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.security.spec;
9
10 import java.math.BigInteger JavaDoc;
11
12 /**
13  * This class specifies a DSA public key with its associated parameters.
14  *
15  * @author Jan Luehe
16  *
17  * @version 1.18, 12/19/03
18  *
19  * @see java.security.Key
20  * @see java.security.KeyFactory
21  * @see KeySpec
22  * @see DSAPrivateKeySpec
23  * @see X509EncodedKeySpec
24  *
25  * @since 1.2
26  */

27
28 public class DSAPublicKeySpec implements KeySpec JavaDoc {
29
30     private BigInteger JavaDoc y;
31     private BigInteger JavaDoc p;
32     private BigInteger JavaDoc q;
33     private BigInteger JavaDoc g;
34
35     /**
36      * Creates a new DSAPublicKeySpec with the specified parameter values.
37      *
38      * @param y the public key.
39      *
40      * @param p the prime.
41      *
42      * @param q the sub-prime.
43      *
44      * @param g the base.
45      */

46     public DSAPublicKeySpec(BigInteger JavaDoc y, BigInteger JavaDoc p, BigInteger JavaDoc q,
47                 BigInteger JavaDoc g) {
48     this.y = y;
49     this.p = p;
50     this.q = q;
51     this.g = g;
52     }
53
54     /**
55      * Returns the public key <code>y</code>.
56      *
57      * @return the public key <code>y</code>.
58      */

59     public BigInteger JavaDoc getY() {
60     return this.y;
61     }
62
63     /**
64      * Returns the prime <code>p</code>.
65      *
66      * @return the prime <code>p</code>.
67      */

68     public BigInteger JavaDoc getP() {
69     return this.p;
70     }
71
72     /**
73      * Returns the sub-prime <code>q</code>.
74      *
75      * @return the sub-prime <code>q</code>.
76      */

77     public BigInteger JavaDoc getQ() {
78     return this.q;
79     }
80
81     /**
82      * Returns the base <code>g</code>.
83      *
84      * @return the base <code>g</code>.
85      */

86     public BigInteger JavaDoc getG() {
87     return this.g;
88     }
89 }
90
Popular Tags