Search in sources :

Example 1 with DelegatedAssetRequest

use of edu.uiuc.ncsa.security.delegation.client.request.DelegatedAssetRequest 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;
}
Also used : DelegatedAssetResponse(edu.uiuc.ncsa.security.delegation.client.request.DelegatedAssetResponse) DelegatedAssetRequest(edu.uiuc.ncsa.security.delegation.client.request.DelegatedAssetRequest) DelegatedAssetResponse(edu.uiuc.ncsa.security.delegation.client.request.DelegatedAssetResponse) Base64String(edu.uiuc.ncsa.security.util.pkcs.Base64String) MyX509Certificates(edu.uiuc.ncsa.security.delegation.token.MyX509Certificates)

Aggregations

DelegatedAssetRequest (edu.uiuc.ncsa.security.delegation.client.request.DelegatedAssetRequest)1 DelegatedAssetResponse (edu.uiuc.ncsa.security.delegation.client.request.DelegatedAssetResponse)1 MyX509Certificates (edu.uiuc.ncsa.security.delegation.token.MyX509Certificates)1 Base64String (edu.uiuc.ncsa.security.util.pkcs.Base64String)1