Wrap Key

Wraps a symmetric key.

Important: Only symmetric keys can be wrapped.

Request

Method

URI

POST

token/1.0/wrap/

Content Type

application/json

Privileges Required

TOKENIZATION_ADMIN or TOKENIZATION_USER

Parameters

Name

Type

Example

data

unicode

TWFyeSBoYWQgYSBsaXR0bGUgbGFtYg==

The symmetric key to be wrapped.

keyGuid

unicode

9f726ba4-3b88-48d7-8a02-df2e8472d4dc

The Key GUID to be used for wrapping.

mode

string

RSA_OAEP_SHA1/RSA_OAEP_SHA256/RSA_OAEP_SHA384/RSA_OAEP_SHA512

The mode of wrapping. The default mode is RSA_OAEP_SHA1. SHA512 is not compatible with RSA-1024 keys.

Example

This example is for wrapping a key using RSA_OAEP_SHA256.

Copy
{

   
"data": "NFIbs4/ntpkx89D0UujnsxIHn7BJAmIL",

"keyGuid": "9f726ba4-3b88-48d7-8a02-df2e8472d4dc",

"mode": "RSA_OAEP_SHA256"

}

Responses

200 Success

Name

Type

Example

value

data

qwrH5piJ0NNcoEc93DJ26hbScXazmc9ytZYlnwpeSyk=

The wrapped key. See the example below.

Example Response

Copy
    {

        "data": "yow4pfPfI4tBmRWYW7bXEqqNYNSjCQFlDEPNhsA8XZPvincv4s7fSVFzHNeeoNKIRbnv+bfU2GWSOgBmMQFiRqsQcZVHfBiDpP4pX9y6kKP/d08I05wtmo3Vr7/m5qpl6Nuc+hKHge1KdUudml55kSJxe3lANHGyn4aif9KQCiXBVvT9czegukreYmeY6JyxHDy8GCYF+HUxT+P/aggkdfuPmx2MmqMIzRUntZPNu/sy8XBRlDfZZULzoQOao3fpZJxeGCHjCbbrM+XNjspjDrK2U7W+JW5Xi6xBbw6D6jXZ8U5Aj2ZCL8p7OmRgduEx7ncijyEvLjRCjddIHDCPpg=="

    }

Errors

401 Authentication Error

Reason

Example

error

Authentication failure

500 Server Error

Reason

Example

error

Server error