home *** CD-ROM | disk | FTP | other *** search
- package sun.security.provider;
-
- import java.io.IOException;
- import java.io.Serializable;
- import java.math.BigInteger;
- import java.security.InvalidKeyException;
- import java.security.interfaces.DSAParams;
- import sun.security.util.DerInputStream;
- import sun.security.util.DerValue;
- import sun.security.x509.AlgIdDSA;
- import sun.security.x509.X509Key;
-
- public final class DSAPublicKey extends X509Key implements java.security.interfaces.DSAPublicKey, Serializable {
- private static boolean debug;
- // $FF: renamed from: y java.math.BigInteger
- private BigInteger field_0;
-
- public DSAPublicKey() {
- }
-
- public DSAPublicKey(byte[] var1) throws InvalidKeyException {
- ((X509Key)this).decode(var1);
- }
-
- public DSAPublicKey(BigInteger var1, BigInteger var2, BigInteger var3, BigInteger var4) throws InvalidKeyException {
- this.field_0 = var1;
- super.algid = new AlgIdDSA(var2, var3, var4);
-
- try {
- super.key = (new DerValue((byte)2, var1.toByteArray())).toByteArray();
- } catch (IOException var6) {
- throw new InvalidKeyException("could not DER encode y: " + ((Throwable)var6).getMessage());
- }
- }
-
- public BigInteger getY() {
- return this.field_0;
- }
-
- public DSAParams getParams() {
- return (DSAParams)super.algid;
- }
-
- protected void parseKeyBits() throws InvalidKeyException {
- try {
- DerInputStream var1 = new DerInputStream(super.key);
- this.field_0 = var1.getInteger().toBigInteger();
- } catch (IOException var2) {
- debug(var2);
- throw new InvalidKeyException("Invalid key: y value\n" + ((Throwable)var2).getMessage());
- }
- }
-
- public String toString() {
- return "Sun DSA Public Key \nparameters:" + super.algid + "\ny: " + this.field_0.toString(16) + "\n";
- }
-
- private static void debug(Throwable var0) {
- if (debug) {
- var0.printStackTrace();
- }
-
- }
- }
-