use of edu.uiuc.ncsa.security.delegation.client.request.DelegatedAssetResponse in project OA4MP by ncsa.
the class AbstractOA4MPService method getCert.
/**
* Does the actual work getting the cert.
*
* @param asset
* @param ag
* @param v
* @return
*/
protected AssetResponse getCert(Asset asset, AuthorizationGrant ag, Verifier v) {
DelegatedAssetRequest dar = new DelegatedAssetRequest();
dar.setAuthorizationGrant(ag);
dar.setClient(getEnvironment().getClient());
dar.setVerifier(v);
dar.setParameters(getATParameters(asset, ag, v));
Map<String, String> m1 = getAssetParameters(asset);
preGetCert(asset, m1);
dar.setAssetParameters(m1);
DelegatedAssetResponse daResp = (DelegatedAssetResponse) getEnvironment().getDelegationService().process(dar);
AssetResponse par = new AssetResponse();
MyX509Certificates myX509Certificate = (MyX509Certificates) daResp.getProtectedAsset();
par.setX509Certificates(myX509Certificate.getX509Certificates());
par.setUsername(daResp.getAdditionalInformation().get("username"));
postGetCert(asset, par);
asset.setUsername(par.getUsername());
asset.setCertificates(par.getX509Certificates());
getEnvironment().getAssetStore().save(asset);
return par;
}
Aggregations