Register a new API User

Last updated 1 year ago

This guide will walk you through the steps to register a new API user on your ledger enterprise workspace, ensuring a secure and professional integration. Follow these detailed instructions to obtain the authentication keys needed to access Ledger Enterprise API seamlessly.

Step 1: Generate API Operator Authentication Keys

Generate the API Operator keys pairs in hexadecimal output format using :

  • Elliptic curve

    • SECP256R1

  • Private key encoding

    • encoding PEM

    • private format TraditionalOpenSSL

  • public key encoding

    • encoding X962

    • private format X9.62 Uncompressed Point

To generate authentication keys in the required format you can get inspiration from the provided code samples:

Python

from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import ec

def generate_keys():
    private_key = ec.generate_private_key(ec.SECP256R1(), default_backend())
    private_key_bytes = private_key.private_bytes(
        encoding=serialization.Encoding.PEM,
        format=serialization.PrivateFormat.TraditionalOpenSSL,
        encryption_algorithm=serialization.NoEncryption(),
    )
    private_key_hex = private_key_bytes.hex()
    
    public_key_bytes = private_key.public_key().public_bytes(
        encoding=serialization.Encoding.X962,
        format=serialization.PublicFormat.UncompressedPoint,
    )
    public_key_hex = public_key_bytes.hex()
    
    return private_key_hex, public_key_hex

# Example of generated keys
private_key, public_key = generate_keys()
print(f"Private Key: {private_key}")
print(f"Public Key: {public_key}")

Javascript

Example Response:

circle-exclamation

Step 2: Register the API user on your workspace

  1. Log in as an Admin to your Ledger Enterprise workspace.

  2. Navigate to the Users section and click "Invite User."

Register an API Operator

  1. Select "Operator - Via Self Managed Key Pair."

  1. Enter the API username (e.g., demo api user) and the API user public key.

  2. Confirm and seek approval from other Admins.

Register an API Admin

  1. Select "API Administrator - Via Self Managed Key Pair"

  1. Enter the API username (e.g., "API Admin 1") and the API user public key.

  2. Confirm and seek approval from other Admins.

circle-exclamation

Step 3: Generate API Access for the new API user

The following steps are the same for an API Operator and an API Admin.

  1. Visit the Users page and click "Generate API Access" next to the respective user. This action is one-time, but API secret regeneration is possible via user permission settings.

  1. Copy the API Key ID and API Secret to a secure location, theses are the authentication credentials.

Step 4: Assign the new API user to workspace rules

API Operator

An API Operator can be assigned to workspace rules just like any other user.

  • You can assign them to a user group.

  • You can assign them directly to an account rules.

API Administrator

Once fully registered, an API Administrator can only make read-only requests. A human administrator must grant them more rights so they can perform more tasks. For this, they should be assigned to an "Admin group".

  1. Go to Settings > Admin rules.

  2. In the table "API Admin rules", edit a rule to add the registered API Administrator to it.

  3. Review and validate the request, it will then have to be reviewed by members of the Master Administration Rule.

chevron-rightCreate account with policyhashtag

The API Administrator will be able to create accounts that using a policy (a set of rules that is common to multiple accounts). They will be able to make two types of requests:

  • Create account with policy

  • Approve a request to create an account with policy

What's next?

Your API user is now ready to take on their first steps.

Last updated