home *** CD-ROM | disk | FTP | other *** search
- package sun.security.x509;
-
- import java.io.ByteArrayOutputStream;
- import java.io.IOException;
- import java.math.BigInteger;
- import java.security.ProviderException;
- import java.security.interfaces.DSAParams;
- import sun.security.util.BigInt;
- import sun.security.util.DerOutputStream;
- import sun.security.util.DerValue;
-
- public final class AlgIdDSA extends AlgorithmId implements DSAParams {
- // $FF: renamed from: p java.math.BigInteger
- private BigInteger field_0;
- // $FF: renamed from: q java.math.BigInteger
- private BigInteger field_1;
- // $FF: renamed from: g java.math.BigInteger
- private BigInteger field_2;
-
- public BigInteger getP() {
- return this.field_0;
- }
-
- public BigInteger getQ() {
- return this.field_1;
- }
-
- public BigInteger getG() {
- return this.field_2;
- }
-
- public AlgIdDSA() {
- }
-
- AlgIdDSA(DerValue var1) throws IOException {
- super(var1.getOID());
- }
-
- public AlgIdDSA(byte[] var1) throws IOException {
- super((new DerValue(var1)).getOID());
- }
-
- public AlgIdDSA(byte[] var1, byte[] var2, byte[] var3) throws IOException {
- this(new BigInteger(1, var1), new BigInteger(1, var2), new BigInteger(1, var3));
- }
-
- public AlgIdDSA(BigInteger var1, BigInteger var2, BigInteger var3) {
- super(AlgorithmId.DSA_oid);
-
- try {
- this.field_0 = var1;
- this.field_1 = var2;
- this.field_2 = var3;
- this.initializeParams();
- } catch (IOException var4) {
- throw new ProviderException("Construct DSS/DSA Algorithm ID");
- }
- }
-
- public String getName() {
- return "DSA";
- }
-
- private void initializeParams() throws IOException {
- DerOutputStream var1 = new DerOutputStream();
- var1.putInteger(new BigInt(this.field_0.toByteArray()));
- var1.putInteger(new BigInt(this.field_1.toByteArray()));
- var1.putInteger(new BigInt(this.field_2.toByteArray()));
- super.params = new DerValue((byte)48, ((ByteArrayOutputStream)var1).toByteArray());
- }
-
- protected void decodeParams() throws IOException {
- if (super.params != null && super.params.tag == 48) {
- super.params.data.reset();
- this.field_0 = super.params.data.getInteger().toBigInteger();
- this.field_1 = super.params.data.getInteger().toBigInteger();
- this.field_2 = super.params.data.getInteger().toBigInteger();
- if (super.params.data.available() != 0) {
- throw new IOException("AlgIdDSA params, extra=" + super.params.data.available());
- }
- } else {
- throw new IOException("DSA alg parsing error");
- }
- }
-
- public String toString() {
- return this.paramsToString();
- }
-
- protected String paramsToString() {
- return "\np: " + this.field_0.toString(16) + "\nq: " + this.field_1.toString(16) + "\ng: " + this.field_2.toString(16) + "\n ";
- }
- }
-