try {
Signature signer = signerCache.get(checkNotNull(creds.get(), "credential supplier returned null"));
signer.update(stringToSign.getBytes(UTF_8));
signed = base64().withSeparator("\n", 61).encode(signer.sign());
} catch (SignatureException e) {
throw new HttpException("error signing request", e);
} catch (ExecutionException e) {
throw new HttpException("couldn't load key for signing request", e);
}
return signed;
}