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