> + } catch (SignatureException e) {
> + throw new HttpException("invalid signature", e);
> + } catch (UnsupportedEncodingException e) {
> + throw new HttpException("invalid encoding", e);
> + }
> +
> + return res;
> + }
> +
> + private static KeyPair getKeyPair(String keyPath) throws IOException {
> + BufferedReader br =
> + new BufferedReader(new
> InputStreamReader(JoyentBlobRequestSigner.class.getResourceAsStream(keyPath)));
> + Security.addProvider(new BouncyCastleProvider());
> + PEMReader pemReader = new PEMReader(br);
> + KeyPair kp = (KeyPair) pemReader.readObject();
> + pemReader.close();
This should be in a `finally` block, to make sure the stream is properly closed.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/188/files#r7141000