🔑 P12 Password Changer API

Change P12 certificate passwords programmatically via REST API

← Back to Web Interface

Overview

The P12 Password Changer API allows you to change passwords for .p12 certificate files programmatically.

Base URL

https://tools.sidelix.vip/p12-password-changer/api/

Features

Endpoint

POST /api/

Change password for a P12 certificate file

Request Parameters

Parameter Type Required Description
p12_file File Required The .p12 certificate file
old_password String Optional Current password (empty if none)
new_password String Required New password to set

Success Response (200)

{
  "success": true,
  "error": null,
  "data": {
    "message": "Password changed successfully",
    "download_url": "https://tools.sidelix.vip/p12-password-changer/download.php?file=...",
    "password": "mynewpassword",
    "filename": "modified_certificate.p12",
    "warning": "Download URL is valid for one-time use only. File will be deleted after first download."
  }
}

Response Fields

Field Description
download_url Direct download link to a ZIP file containing the modified certificate and a README with password info. One-time use only - file is deleted after first download.
password The new password that was set on the certificate
filename Suggested filename for saving the certificate
warning Important notice about download URL being single-use only

Error Response (400)

{
  "success": false,
  "error": "Incorrect old password",
  "data": null
}

Examples

cURL

curl -X POST https://tools.sidelix.vip/p12-password-changer/api/ \
  -F "[email protected]" \
  -F "old_password=oldpass123" \
  -F "new_password=newpass456"

Python

import requests

url = "https://tools.sidelix.vip/p12-password-changer/api/"

with open("certificate.p12", "rb") as f:
    files = {"p12_file": f}
    data = {
        "old_password": "oldpass123",
        "new_password": "newpass456"
    }
    
    response = requests.post(url, files=files, data=data)
    result = response.json()

    if result["success"]:
        download_url = result["data"]["download_url"]
        print(f"Success! New password: {result['data']['password']}")
        print(f"Download URL: {download_url}")
        print(f"Warning: {result['data']['warning']}")

        # Download the ZIP file
        zip_response = requests.get(download_url)
        with open("modified_certificate.zip", "wb") as out:
            out.write(zip_response.content)
        print("Downloaded modified_certificate.zip")
    else:
        print(f"Error: {result['error']}")

JavaScript

const formData = new FormData();
formData.append('p12_file', fileInput.files[0]);
formData.append('old_password', 'oldpass123');
formData.append('new_password', 'newpass456');

fetch('https://tools.sidelix.vip/p12-password-changer/api/', {
    method: 'POST',
    body: formData
})
.then(response => response.json())
.then(data => {
    if (data.success) {
        console.log('Success! New password:', data.data.password);
        console.log('Warning:', data.data.warning);

        // Redirect to download URL or open in new tab
        window.open(data.data.download_url, '_blank');

        // Or trigger automatic download
        // window.location.href = data.data.download_url;
    } else {
        console.error('Error:', data.error);
    }
});

Error Messages

Support