sdkms.v1.apis.digest_api module

Fortanix DSM REST API

This is a set of REST APIs for accessing the Fortanix Data Security Manager. This includes APIs for managing accounts, and for performing cryptographic and key management operations.

OpenAPI spec version: 1.0.0-20200608 Contact: support@fortanix.com Generated by: https://github.com/swagger-api/swagger-codegen.git

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class sdkms.v1.apis.digest_api.DigestApi(api_client=None)[source]

Bases: object

__init__(api_client=None)[source]
batch_mac(body, async_call=False, **kwargs)[source]

Message to compute a cryptographic Message Authentication Code and the key ids to be used are provided in the request body. The MAC is returned in the response body. The ordering of the body matches the ordering of the request. An individual status code is returned for each batch item. Maximum size of the entire batch request is 512 KB.

Parameters:
  • async_call (bool) – Whether the call should be performed asynchronously. (Default is False).

  • body (BatchMacRequest) – Batch MAC request (required)

Return type:

BatchMacResponse

Returns:

If the method is called asynchronously, returns the request thread.

batch_mac_verify(body, async_call=False, **kwargs)[source]

The data to be MACed, the algorithm, a pre-computed MAC are provided in the request body, and the key id to be used are provided in the request body. The MAC is returned in the response body. The ordering of the body matches the ordering of the request. An individual status code is returned for each batch item. Maximum size of the entire batch request is 512 KB.

Parameters:
  • async_call (bool) – Whether the call should be performed asynchronously. (Default is False).

  • body (BatchMacVerifyRequest) – Batch MAC verify request (required)

Return type:

BatchVerifyResponse

Returns:

If the method is called asynchronously, returns the request thread.

compute_digest(body, async_call=False, **kwargs)[source]

This returns the digest of data provided in request body using the algorithm specified in request body. Maximum size of request body supported is 512KB.

Parameters:
  • async_call (bool) – Whether the call should be performed asynchronously. (Default is False).

  • body (DigestRequest) – Digest request (required)

Return type:

DigestResponse

Returns:

If the method is called asynchronously, returns the request thread.

compute_mac(key_id, body, async_call=False, **kwargs)[source]

Compute a cryptographic Message Authentication Code on a message using a symmetric key. The key must have the MACGenerate operation enabled. Asymmetric keys may not be used to generate MACs. They can be used with the sign and verify operations.

Parameters:
  • async_call (bool) – Whether the call should be performed asynchronously. (Default is False).

  • key_id (str) – kid of security object (required)

  • body (MacGenerateRequest) – MAC generation request (required)

Return type:

MacGenerateResponse

Returns:

If the method is called asynchronously, returns the request thread.

compute_mac_ex(body, async_call=False, **kwargs)[source]

Compute a cryptographic Message Authentication Code on a message using a symmetric key. The key must have the MACGenerate operation enabled. Asymmetric keys may not be used to generate MACs. They can be used with the sign and verify operations.

Parameters:
  • async_call (bool) – Whether the call should be performed asynchronously. (Default is False).

  • body (MacGenerateRequestEx) – MAC generation request (required)

Return type:

MacGenerateResponse

Returns:

If the method is called asynchronously, returns the request thread.

verify_mac(key_id, body, async_call=False, **kwargs)[source]

The data to be MACed, the algorithm, and a pre-computed MAC are provided in the request body, and the key id is provided in the URL. SDKMS computes the MAC of the data and compares it with the specified MAC, and returns the outcome of the MAC verification in the response body. Maximum size of request body supported is 512KB. Supported digest algorithms are - SHA1, SHA256, SHA384, and SHA512.

Parameters:
  • async_call (bool) – Whether the call should be performed asynchronously. (Default is False).

  • key_id (str) – kid of security object (required)

  • body (MacVerifyRequest) – MAC Verify request (required)

Return type:

MacVerifyResponse

Returns:

If the method is called asynchronously, returns the request thread.

verify_mac_ex(body, async_call=False, **kwargs)[source]

The data to be MACed, the algorithm, and a pre-computed MAC are provided in the request body, and the key id is provided in the URL. SDKMS computes the MAC of the data and compares it with the specified MAC, and returns the outcome of the MAC verification in the response body. Maximum size of request body supported is 512KB. Supported digest algorithms are - SHA1, SHA256, SHA384, and SHA512.

Parameters:
  • async_call (bool) – Whether the call should be performed asynchronously. (Default is False).

  • body (MacVerifyRequestEx) – MAC Verify request (required)

Return type:

MacVerifyResponse

Returns:

If the method is called asynchronously, returns the request thread.