if (ignoreCase.startsWith( "x-amz-" ))
auth.addAmazonHeader( headerName + ":" + headers[i].getValue());
}
UserInfo info = ServiceProvider.getInstance().getUserInfo(AWSAccessKey);
if (info == null) throw new PermissionDeniedException("Unable to authenticate access key: " + AWSAccessKey);
try {
if (auth.verifySignature( request.getMethod(), info.getSecretKey(), signature )) {
UserContext.current().initContext(AWSAccessKey, info.getSecretKey(), AWSAccessKey, info.getDescription(), request);
return;
}
} catch (SignatureException e) {
throw new PermissionDeniedException(e);
} catch (UnsupportedEncodingException e) {
throw new PermissionDeniedException(e);
}
throw new PermissionDeniedException("Invalid signature");
}