Difference between revisions of "Key REST API"

From Dogtag
Jump to: navigation, search
m (Edewata moved page Key API to Key REST API without leaving a redirect)
m (Retrieving a Key)
Line 1: Line 1:
 +
= Archiving a Key =
 +
 +
Request:
 +
 +
<pre>
 +
{
 +
    "Attributes": {
 +
        "Attribute": [
 +
            {
 +
                "name": "clientKeyID",
 +
                "value": "ipa:/users/<user>/<vault>"
 +
            },
 +
            {
 +
                "name": "dataType",
 +
                "value": "passPhrase"
 +
            },
 +
            {
 +
                "name": "wrappedPrivateData",
 +
                "value": <base64-encoded data>
 +
            },
 +
            {
 +
                "name": "transWrappedSessionKey",
 +
                "value": <base64-encoded data>
 +
            },
 +
            {
 +
                "name": "algorithmOID",
 +
                "value": "{1 2 840 113549 3 7}"
 +
            },
 +
            {
 +
                "name": "symmetricAlgorithmParams",
 +
                "value": <base64-encoded data>
 +
            }
 +
        ]
 +
    },
 +
    "ClassName": "com.netscape.certsrv.key.KeyArchivalRequest"
 +
}
 +
</pre>
 +
 +
Response:
 +
 +
<pre>
 +
{
 +
    "RequestInfo": {
 +
        "requestType": "securityDataEnrollment",
 +
        "requestStatus": "begin",
 +
        "requestURL": "https://localhost:8443/kra/rest/agent/keyrequests/<request ID>",
 +
        "keyURL": "https://localhost:8443/kra/rest/agent/keys/<key ID>"
 +
    }
 +
}
 +
</pre>
 +
 
= Retrieving a Key =
 
= Retrieving a Key =
  
Line 11: Line 62:
 
             {
 
             {
 
                 "name": "keyId",
 
                 "name": "keyId",
                 "value": "22"
+
                 "value": <key ID>
 
             },
 
             },
 
             {
 
             {
Line 52: Line 103:
 
             {
 
             {
 
                 "name": "keyId",
 
                 "name": "keyId",
                 "value": "3"
+
                 "value": <key ID>
 
             },
 
             },
 
             {
 
             {

Revision as of 17:14, 11 October 2019

Archiving a Key

Request:

{
    "Attributes": {
        "Attribute": [
            {
                "name": "clientKeyID",
                "value": "ipa:/users/<user>/<vault>"
            },
            {
                "name": "dataType",
                "value": "passPhrase"
            },
            {
                "name": "wrappedPrivateData",
                "value": <base64-encoded data>
            },
            {
                "name": "transWrappedSessionKey",
                "value": <base64-encoded data>
            },
            {
                "name": "algorithmOID",
                "value": "{1 2 840 113549 3 7}"
            },
            {
                "name": "symmetricAlgorithmParams",
                "value": <base64-encoded data>
            }
        ]
    },
    "ClassName": "com.netscape.certsrv.key.KeyArchivalRequest"
}

Response:

{
    "RequestInfo": {
        "requestType": "securityDataEnrollment",
        "requestStatus": "begin",
        "requestURL": "https://localhost:8443/kra/rest/agent/keyrequests/<request ID>",
        "keyURL": "https://localhost:8443/kra/rest/agent/keys/<key ID>"
    }
}

Retrieving a Key

Retrieving Key With DES3/CBC/Pad

Request:

{
    "Attributes": {
        "Attribute": [
            {
                "name": "keyId",
                "value": <key ID>
            },
            {
                "name": "transWrappedSessionKey",
                "value": <base64-encoded data>
            },
            {
                "name": "payloadEncryptionOID",
                "value": "{1 2 840 113549 3 7}"
            },
            {
                "name": "payloadWrappingName",
                "value": "DES3/CBC/Pad"
            }
        ]
    },
    "ClassName": "com.netscape.certsrv.key.KeyRecoveryRequest"
}

Response:

{
    "wrappedPrivateData": <base64-encoded data>,
    "nonceData": <base64-encoded data>,
    "encryptAlgorithmOID": "DESede/CBC/PKCS5Padding/168",
    "type": "passPhrase"
}

Retrieving Key with AES KeyWrap/Padding

Request:

{
    "Attributes": {
        "Attribute": [
            {
                "name": "keyId",
                "value": <key ID>
            },
            {
                "name": "transWrappedSessionKey",
                "value": <base64-encoded data>
            },
            {
                "name": "payloadEncryptionOID",
                "value": "{2 16 840 1 101 3 4 1 2}"
            },
            {
                "name": "payloadWrappingName",
                "value": "AES KeyWrap/Padding"
            }
        ]
    },
    "ClassName": "com.netscape.certsrv.key.KeyRecoveryRequest"
}

Response:

{
    "wrappedPrivateData": <base64-encoded data>,
    "nonceData": <base64-encoded data>,
    "encryptAlgorithmOID": "AES/CBC/PKCS5Padding/128",
    "type": "passPhrase"
}

See Also