@Override
public boolean resign(IOSKeyVaultEntry keyVaultEntry, ApplicationVersion applicationVersion, AppState requestedAppState) {
boolean success = false;
WebRequest webRequest = WebRequest.getInstance();
if (keyVaultEntry != null && keyVaultEntry instanceof IOSKeyVaultEntry && applicationVersion != null && requestedAppState != null && webRequest != null) {
SQSResignerModel model = new SQSResignerModel();
model.setBucket(getBucketName(applicationVersion));
model.setApplicationType(keyVaultEntry.getApplicationType());
model.setFileToSign(applicationVersion.getInstallationFile().getRelativePath());
model.setDistributionCert(keyVaultEntry.getDistributionCert().getRelativePath());
model.setDistributionKey((keyVaultEntry).getDistributionKey().getRelativePath());
model.setDistributionKeyPassword((keyVaultEntry).getDistributionKeyPassword());
model.setDistributionProfile((keyVaultEntry).getDistributionProfile().getRelativePath());
NameValuePair requestedAppStateParam = new BasicNameValuePair("appState", requestedAppState.name());
NameValuePair initiationUserParam = new BasicNameValuePair("user", applicationVersion.getChangedBy());
model.setCallbackUrl(webRequest.generateURL(String.format("/resigner/webhook/%s", applicationVersion.getId()), requestedAppStateParam, initiationUserParam));
if (checkAllRequiredFields(model)) {
success = super.resign(model);
}
}