1/* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18package java.security.spec; 19 20import java.math.BigInteger; 21import java.security.interfaces.DSAParams; 22 23/** 24 * The parameter specification used with the Digital Signature Algorithm (DSA). 25 */ 26public class DSAParameterSpec implements AlgorithmParameterSpec, DSAParams { 27 // Prime 28 private final BigInteger p; 29 // Sub-prime 30 private final BigInteger q; 31 // Base 32 private final BigInteger g; 33 34 /** 35 * Creates a new {@code DSAParameterSpec} with the specified prime {@code p}, 36 * sub-prime {@code q} and the base {@code g}. 37 * 38 * @param p 39 * the prime {@code p}. 40 * @param q 41 * the sub-prime {@code q}. 42 * @param g 43 * the base {@code g}; 44 */ 45 public DSAParameterSpec(BigInteger p, BigInteger q, BigInteger g) { 46 this.p = p; 47 this.q = q; 48 this.g = g; 49 } 50 51 /** 52 * Returns the base {@code g}. 53 * 54 * @return the base {@code g}. 55 */ 56 public BigInteger getG() { 57 return g; 58 } 59 60 /** 61 * Returns the prime {@code p}. 62 * 63 * @return the prime {@code p}. 64 */ 65 public BigInteger getP() { 66 return p; 67 } 68 69 /** 70 * Returns the sub-prime {@code q}. 71 * 72 * @return the sub-prime {@code q}. 73 */ 74 public BigInteger getQ() { 75 return q; 76 } 77} 78