Specific Batch Operations

Prev Next

1.0 Overview

The following example uses specific Batch APIs to perform encryption, decryption, signing, and verifying operations.

For more information on how to use specific Batch API for encryption, decryption, signing, and verifying, refer to the following:

2.0 REST API Using the curl Command for Encryption

curl '<ENDPOINT-URL>/crypto/v1/keys/batch/encrypt' \
--header 'Authorization: Bearer YhXwwa-6C...ig5g' \
--data '[
    {
        "kid": "<KEY-UUID>",
        "request": {
            "alg": "AES",
            "plain": "<PLAIN-DATA>",
            "mode": "FPE"
        }
    },
    {
        "kid": "<KEY-UUID>",
        "request": {
            "alg": "AES",
            "plain": "<PLAIN-DATA>",
            "mode": "FPE"
        }
    },
    {
        "kid": "<KEY-UUID>",
        "request": {
            "alg": "AES",
            "plain": "<PLAIN-DATA>",
            "mode": "FPE"
        }
    }
]'

Response:

[
    {
        "status": 200,
        "body": {
            "kid": "<KEY-UUID>",
            "cipher": "<CIPHER-DATA>"
        }
    },
    {
        "status": 200,
        "body": {
            "kid": "<KEY-UUID>",
            "cipher": "<CIPHER-DATA>"
        }
    },
    {
        "status": 200,
        "body": {
            "kid": "<KEY-UUID>",
            "cipher": "<CIPHER-DATA>"
        }
    }
]

3.0 REST API Using the curl Command for Decryption

curl '<ENDPOINT-URL>/crypto/v1/keys/batch/decrypt' \
--header 'Authorization: Bearer YhXwwa-6C...ig5g' \
--data '[
    {
        "kid": "<KEY-UUID>",
        "request": {
            "alg": "AES",
            "cipher": "<CIPHER-DATA>",
            "mode": "FPE"
        }
    },
    {
        "kid": "<KEY-UUID>",
        "request": {
            "alg": "AES",
            "cipher": "<CIPHER-DATA>",
            "mode": "FPE"
        }
    },
    {
        "kid": "<KEY-UUID>",
        "request": {
            "alg": "AES",
            "cipher": "<CIPHER-DATA>",
            "mode": "FPE"
        }
    }
]'

Response:

[
    {
        "status": 200,
        "body": {
            "kid": "<KEY-UUID>",
            "plain": "<PLAIN-DATA>"
        }
    },
    {
        "status": 200,
        "body": {
            "kid": "<KEY-UUID>",
            "plain": "<PLAIN-DATA>"
        }
    },
    {
        "status": 200,
        "body": {
            "kid": "<KEY-UUID>",
            "plain": "<PLAIN-DATA>"
        }
    }
]

4.0 REST API Using the curl Command for Signing

curl '<ENDPOINT-URL>/crypto/v1/keys/batch/sign' \
--header 'Authorization: Bearer YhXwwa-6C...ig5g' \
--data '[
    {
        "key": {"kid": "KEY-UUID"},
        "hash_alg": "Sha256",
        "hash": "<HASH-VALUE>"
    },
    {
        "key": {"kid": "KEY-UUID"},
        "hash_alg": "Sha256",
        "hash": "<HASH-VALUE>"
    },
    {
        "key": {"kid": "KEY-UUID"},
        "hash_alg": "Sha256",
        "hash": "<HASH-VALUE>"
    }
]'

Response:

[
    {
        "status": 200,
        "body": {
            "kid": "<KEY-UUID>",
            "signature": "<SIGNATURE>"
        }
    },
    {
        "status": 200,
        "body": {
            "kid": "<KEY-UUID>",
            "signature": "<SIGNATURE>"
        }
    },
    {
        "status": 200,
        "body": {
            "kid": "<KEY-UUID>",
            "signature": "<SIGNATURE>"
        }
    }
]

5.0 REST API Using the curl Command for Verifying

curl '<ENDPOINT-URL>/crypto/v1/keys/batch/verify' \
--header 'Authorization: Bearer YhXwwa-6C...ig5g' \
--data '[
    {
        "key": {
            "kid": "<KEY-UUID>"
        },
        "hash_alg": "Sha256",
        "hash": "<HASH-VALUE>",
        "signature": "<SIGNATURE>"
    },
    {
        "key": {
            "kid": "<KEY-UUID>"
        },
        "hash_alg": "Sha256",
        "hash": "<HASH-VALUE>",
        "signature": "<SIGNATURE>"
    },
    {
        "key": {
            "kid": "<KEY-UUID>"
        },
        "hash_alg": "Sha256",
        "hash": "<HASH-VALUE>",
        "signature": "<SIGNATURE>"
    }
]'

Response:

[
    {
        "status": 200,
        "body": {
            "kid": "<KEY-UUID>",
            "result": true
        }
    },
    {
        "status": 200,
        "body": {
            "kid": "<KEY-UUID>",
            "result": true
        }
    },
    {
        "status": 200,
        "body": {
            "kid": "<KEY-UUID>",
            "result": true
        }
    }
]