rename fcplib to jFCPlib
[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  * @version $Id$
31  */
32 public class DSAGroup {
33
34         /** The base of the DSA group. */
35         private final String base;
36
37         /** The prime of the DSA group. */
38         private final String prime;
39
40         /** The subprime of the DSA group. */
41         private final String subprime;
42
43         /**
44          * Creates a new DSA group with the given base (“g”), prime (“p”), and
45          * subprime (“q”).
46          * 
47          * @param base
48          *            The base of the DSA group
49          * @param prime
50          *            The prime of the DSA group
51          * @param subprime
52          *            The subprime of the DSA group
53          */
54         public DSAGroup(String base, String prime, String subprime) {
55                 this.base = base;
56                 this.prime = prime;
57                 this.subprime = subprime;
58         }
59
60         /**
61          * Returns the base (“g”) of the DSA group.
62          * 
63          * @return The base of the DSA group
64          */
65         public String getBase() {
66                 return base;
67         }
68
69         /**
70          * Returns the prime (“p”) of the DSA group.
71          * 
72          * @return The prime of the DSA group
73          */
74         public String getPrime() {
75                 return prime;
76         }
77
78         /**
79          * Returns the subprime (“q”) of the DSA group.
80          * 
81          * @return The subprime of the DSA group
82          */
83         public String getSubprime() {
84                 return subprime;
85         }
86
87 }