@@ -111,14 +111,16 @@ public IRubyObject initialize(final ThreadContext context, final IRubyObject[] a
111
111
throw newRequestError(runtime, "invalid certificate request data", e);
112
112
}
113
113
114
- final String algorithm; final byte[] encoded;
114
+ final String algorithm;
115
+ final byte[] encoded;
115
116
try {
116
117
final PublicKey pkey = request.generatePublicKey();
117
118
algorithm = pkey.getAlgorithm();
118
119
encoded = pkey.getEncoded();
119
120
}
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
+ }
122
124
123
125
final RubyString enc = RubyString.newString(runtime, encoded);
124
126
if ( "RSA".equalsIgnoreCase(algorithm) ) {
@@ -127,6 +129,9 @@ public IRubyObject initialize(final ThreadContext context, final IRubyObject[] a
127
129
else if ( "DSA".equalsIgnoreCase(algorithm) ) {
128
130
this.public_key = newPKeyImplInstance(context, "DSA", enc);
129
131
}
132
+ else if ( "EC".equalsIgnoreCase(algorithm) ) {
133
+ this.public_key = newPKeyImplInstance(context, "EC", enc);
134
+ }
130
135
else {
131
136
throw runtime.newNotImplementedError("public key algorithm: " + algorithm);
132
137
}
0 commit comments