Crittora Logo
Getting StartedChangelogContact Support

Sign & Encrypt API

POST

https://managed.crittoraapis.com/v1/sign-encrypt

This API performs digital signing and encryption in one secure operation using the Crittora API. The response includes both the encrypted data and the digital signature, ensuring confidentiality and non-repudiation.

Purpose

The Sign & Encrypt API provides a secure way to both digitally sign and encrypt data in a single operation. This endpoint authenticates users through AWS Cognito and leverages Crittora's combined signing and encryption capabilities. It's perfect for scenarios where you need to ensure both data confidentiality and authenticity with non-repudiation.


API Details

Headers
HeaderTypeDescriptionRequired
usernamestringAWS Cognito username
Yes
passwordstringAWS Cognito password
Yes
api_keystringCrittora partner API key
Yes
access_keystringCrittora partner access key
Yes
secret_keystringCrittora partner secret key
Yes
Request Body
{
  "data": "plain_text_to_sign_and_encrypt"
}
FieldTypeDescriptionRequired
datastringRaw plaintext data to be processed
Yes
Response

A successful response will include the encrypted output along with its digital signature and associated metadata.

Example Response:
{
  "statusCode": 200,
  "body": {
    "encrypted_data": "ugHTJ-ziCZ-QmWh8ruNJ0ojgwY8iA7OmPVGZDzVlGmImv4A4xWJ6HLchv_dRFZEdl7CB8i_F8KlEgTumCAY86B4n5jltbB8NnSiIvlyZT8WkyIDVCJX6F7VT6R_Wt99PjTg7Q"
  }
}
Status Codes

HTTP status codes returned by the sign-encrypt endpoint.

Success Codes
CodeNameDescriptionUsageExample

200

OK

Successfully signed and encrypted data

Request completed successfully

Sign and encrypt operation completed

Error Codes
CodeNameDescriptionUsageExample

500

Internal Server Error

Username and/or Password Incorrect

Authentication credentials are invalid

Invalid AWS Cognito username or password

Code Examples
cURL Example:
curl -X POST https://managed.crittoraapis.com/v1/sign-encrypt \
  -H "Content-Type: application/json" \
  -H "username: your_cognito_username" \
  -H "password: your_cognito_password" \
  -H "api_key: your_crittora_api_key" \
  -H "access_key: your_crittora_access_key" \
  -H "secret_key: your_crittora_secret_key" \
  -d '{
    "data": "sensitive information to sign and encrypt"
  }'

JavaScript Example:
// Using fetch API
const signAndEncrypt = async (data) => {
  const response = await fetch('https://managed.crittoraapis.com/v1/sign-encrypt', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'username': 'your_cognito_username',
      'password': 'your_cognito_password',
      'api_key': 'your_crittora_api_key',
      'access_key': 'your_crittora_access_key',
      'secret_key': 'your_crittora_secret_key'
    },
    body: JSON.stringify({ data })
  });
  
  return await response.json();
};

Python Example:
import requests

def sign_and_encrypt(data):
    url = "https://managed.crittoraapis.com/v1/sign-encrypt"
    headers = {
        "Content-Type": "application/json",
        "username": "your_cognito_username",
        "password": "your_cognito_password",
        "api_key": "your_crittora_api_key",
        "access_key": "your_crittora_access_key",
        "secret_key": "your_crittora_secret_key"
    }
    
    payload = {"data": data}
    response = requests.post(url, headers=headers, json=payload)
    return response.json()
Operational Flow
  1. Authenticate with AWS Cognito using the supplied username and password.
  2. Send request to Crittora's /sign-encrypt API with:
    • Cognito bearer token
    • Crittora partner credentials
    • Raw data and requested actions ["s", "e"]
  3. Receive encrypted payload and digital signature.
  4. Return combined result to the caller.
Use Cases
  • Secure financial transactions
  • Legal document signing and protection
  • Sending confidential messages with proof of origin
  • Ensuring tamper-evidence in shared datasets

Try it out: Use the interactive API interface below to test the sign-encrypt endpoint with your data.

Loading API specification...

Powered by AWS • Partner Technology • Patent Pending PQC Technology