blob: 78ce15344458f7277a92e86f19fb1f6823d981c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
package com.netscape.certsrv.key;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import org.jboss.resteasy.annotations.ClientResponseType;
import com.netscape.certsrv.acls.ACLMapping;
import com.netscape.certsrv.authentication.AuthMethodMapping;
@Path("agent/keys")
@ACLMapping("keys")
@AuthMethodMapping("keys")
public interface KeyResource {
@GET
@ClientResponseType(entityType=KeyInfoCollection.class)
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response listKeys(@QueryParam("clientID") String clientID,
@QueryParam("status") String status,
@QueryParam("maxResults") Integer maxResults,
@QueryParam("maxTime") Integer maxTime,
@QueryParam("start") Integer start,
@QueryParam("size") Integer size);
@GET
@Path("active/{clientID}")
@ClientResponseType(entityType=KeyInfo.class)
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response getActiveKeyInfo(@PathParam("clientID") String clientID);
/**
* Used to retrieve a key
* @param data
* @return
*/
@POST
@Path("retrieve")
@ClientResponseType(entityType=KeyData.class)
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response retrieveKey(KeyRecoveryRequest data);
// retrieval - used to test integration with a browser
@POST
@Path("retrieve")
@ClientResponseType(entityType=KeyData.class)
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_FORM_URLENCODED })
public Response retrieveKey(MultivaluedMap<String, String> form);
}
|