@@ -33,10 +33,10 @@ public DSAPublicKey(DSAGroup g, BigInteger y) {
3333 if (y .signum () != 1 )
3434 throw new IllegalArgumentException ();
3535 this .y = y ;
36- if ( g == Global .DSAgroupBigA ) g = null ;
37- this . group = g ;
38- if ( y . compareTo ( getGroup ().getP ()) > 0 )
39- throw new IllegalArgumentException ( "y must be < p but y=" + y + " p=" + g . getP ());
36+ this . group = g == Global .DSAgroupBigA ? null : g ;
37+ if ( y . compareTo ( getGroup (). getP ()) > 0 ) {
38+ throw new IllegalArgumentException ( "y must be < p but y=" + y + " p=" + getGroup ().getP ());
39+ }
4040 }
4141
4242 /**
@@ -88,10 +88,8 @@ public String keyType() {
8888 return "DSA.p" ;
8989 }
9090
91- // Nope, this is fine
9291 public final DSAGroup getGroup () {
93- if (group == null ) return Global .DSAgroupBigA ;
94- else return group ;
92+ return group == null ? Global .DSAgroupBigA : group ;
9593 }
9694
9795 public static CryptoKey read (InputStream i ) throws IOException , CryptFormatException {
@@ -160,15 +158,10 @@ public SimpleFieldSet asFieldSet() {
160158 }
161159
162160 public static DSAPublicKey create (SimpleFieldSet set , DSAGroup group ) throws FSParseException {
163- BigInteger x ;
164- try {
165- x = new BigInteger (1 , Base64 .decode (set .get ("y" )));
166- } catch (IllegalBase64Exception e ) {
167- throw new FSParseException (e );
168- }
169161 try {
170- return new DSAPublicKey (group , x );
171- } catch (IllegalArgumentException e ) {
162+ BigInteger y = new BigInteger (1 , Base64 .decode (set .get ("y" )));
163+ return new DSAPublicKey (group , y );
164+ } catch (IllegalBase64Exception | IllegalArgumentException e ) {
172165 throw new FSParseException (e );
173166 }
174167 }
0 commit comments