@@ -111,14 +111,16 @@ public IRubyObject initialize(final ThreadContext context, final IRubyObject[] a
111111 throw newRequestError (runtime , "invalid certificate request data" , e );
112112 }
113113
114- final String algorithm ; final byte [] encoded ;
114+ final String algorithm ;
115+ final byte [] encoded ;
115116 try {
116117 final PublicKey pkey = request .generatePublicKey ();
117118 algorithm = pkey .getAlgorithm ();
118119 encoded = pkey .getEncoded ();
119120 }
120- catch (IOException e ) { throw newRequestError (runtime , e ); }
121- catch (GeneralSecurityException e ) { throw newRequestError (runtime , e ); }
121+ catch (IOException |GeneralSecurityException e ) {
122+ throw newRequestError (runtime , e );
123+ }
122124
123125 final RubyString enc = RubyString .newString (runtime , encoded );
124126 if ( "RSA" .equalsIgnoreCase (algorithm ) ) {
@@ -127,6 +129,9 @@ public IRubyObject initialize(final ThreadContext context, final IRubyObject[] a
127129 else if ( "DSA" .equalsIgnoreCase (algorithm ) ) {
128130 this .public_key = newPKeyImplInstance (context , "DSA" , enc );
129131 }
132+ else if ( "EC" .equalsIgnoreCase (algorithm ) ) {
133+ this .public_key = newPKeyImplInstance (context , "EC" , enc );
134+ }
130135 else {
131136 throw runtime .newNotImplementedError ("public key algorithm: " + algorithm );
132137 }
0 commit comments