0dc1d408b70c3ccb3d9ab132ab07cdd74957463c
[jFCPlib.git] / src / net / pterodactylus / fcp / DSAGroup.java
1 /*
2  * jSite2 - DSAGroup.java -
3  * Copyright © 2008 David Roden
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 package net.pterodactylus.fcp;
21
22 import java.security.interfaces.DSAParams;
23
24 /**
25  * Container for the DSA group of a peer. A DSA group consists of a base (called
26  * “g”), a prime (called “p”) and a subprime (called “q”).
27  * 
28  * @see DSAParams
29  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
30  */
31 public class DSAGroup {
32
33         /** The base of the DSA group. */
34         private final String base;
35
36         /** The prime of the DSA group. */
37         private final String prime;
38
39         /** The subprime of the DSA group. */
40         private final String subprime;
41
42         /**
43          * Creates a new DSA group with the given base (“g”), prime (“p”), and
44          * subprime (“q”).
45          * 
46          * @param base
47          *            The base of the DSA group
48          * @param prime
49          *            The prime of the DSA group
50          * @param subprime
51          *            The subprime of the DSA group
52          */
53         public DSAGroup(String base, String prime, String subprime) {
54                 this.base = base;
55                 this.prime = prime;
56                 this.subprime = subprime;
57         }
58
59         /**
60          * Returns the base (“g”) of the DSA group.
61          * 
62          * @return The base of the DSA group
63          */
64         public String getBase() {
65                 return base;
66         }
67
68         /**
69          * Returns the prime (“p”) of the DSA group.
70          * 
71          * @return The prime of the DSA group
72          */
73         public String getPrime() {
74                 return prime;
75         }
76
77         /**
78          * Returns the subprime (“q”) of the DSA group.
79          * 
80          * @return The subprime of the DSA group
81          */
82         public String getSubprime() {
83                 return subprime;
84         }
85
86 }