Skip to content

Commit

Permalink
Add KRA KeyService to v2 APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarco76 committed Aug 9, 2024
1 parent e9c1af4 commit e7281d0
Show file tree
Hide file tree
Showing 7 changed files with 986 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ public class MediaType {
public static final String APPLICATION_PKIX_CERT = "application/pkix-cert";

public static final String APPLICATION_X_PEM_FILE = "application/x-pem-file";

public static final String APPLICATION_FORM_URLENCODED = "application/x-www-form-urlencoded";
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*/
package com.netscape.certsrv.key;

import java.util.Map;

import javax.ws.rs.core.MultivaluedMap;

import com.fasterxml.jackson.annotation.JsonIgnore;
Expand Down Expand Up @@ -73,6 +75,31 @@ public KeyRecoveryRequest(RESTMessage data) {
setClassName(getClass().getName());
}

public KeyRecoveryRequest(Map<String, String[]> parameterMap) {
if (parameterMap.containsKey(KEY_ID)) {
attributes.put(KEY_ID, parameterMap.get(KEY_ID)[0]);
}
if (parameterMap.containsKey(REQUEST_ID)) {
attributes.put(REQUEST_ID, parameterMap.get(REQUEST_ID)[0]);
}
if (parameterMap.containsKey(TRANS_WRAPPED_SESSION_KEY)) {
attributes.put(TRANS_WRAPPED_SESSION_KEY, parameterMap.get(TRANS_WRAPPED_SESSION_KEY)[0]);
}
if (parameterMap.containsKey(SESSION_WRAPPED_PASSPHRASE)) {
attributes.put(SESSION_WRAPPED_PASSPHRASE, parameterMap.get(SESSION_WRAPPED_PASSPHRASE)[0]);
}
if (parameterMap.containsKey(NONCE_DATA)) {
attributes.put(NONCE_DATA, parameterMap.get(NONCE_DATA)[0]);
}
if (parameterMap.containsKey(CERTIFICATE)) {
attributes.put(CERTIFICATE, parameterMap.get(CERTIFICATE)[0]);
}
if (parameterMap.containsKey(PASSPHRASE)) {
attributes.put(PASSPHRASE, parameterMap.get(PASSPHRASE)[0]);
}
setClassName(getClass().getName());
}

/**
* @return the keyId
*/
Expand Down
Loading

0 comments on commit e7281d0

Please sign in to comment.