360 Secure SkillHub
360 安全技能中心

Lock PDF

通过外部 PDF 服务的接口,为 PDF 设置用户密码与所有者密码,选择 AES-256、AES-128 或 RC4-128 加密方式,并细粒度配置打印、复制、修改、注释等权限,最终返回受密码保护的 PDF。

rishabhdugar
rishabhdugar
热度 47.42
最近更新 2026-05-11 17:44:07
分类:安全依赖:第三方 API应用场景:文件转换 / API 集成 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add lock-pdf
Metadata
name
lock-pdf
description
Add password protection and encryption to a PDF. Supports AES-256, AES-128, RC4-128 encryption and granular permissions.

Lock PDF

What It Does

Encrypts a PDF with password protection. Supports AES-256 (default), AES-128, and RC4-128 encryption. Allows setting separate user and owner passwords with granular permission controls.

When to Use

  • Protect a PDF with a password before sharing
  • Set permissions (allow print but deny copy/modify)
  • Re-encrypt an already encrypted PDF with a new password

Required Inputs

  • password — user password (required to open the PDF)
  • Plus one of: url, base64_pdf, or multipart file upload

Authentication

Send your API key in the CLIENT-API-KEY header.

Get your free API key at https://pdfapihub.com. Full API documentation is available at https://pdfapihub.com/docs.

Use Cases

  • Confidential Document Protection — Encrypt contracts, NDAs, or financial reports before sharing
  • Read-Only Distribution — Allow viewing and printing but prevent copying or editing
  • Client Deliverables — Password-protect reports or proposals sent to clients
  • Compliance — Encrypt sensitive PDFs (HIPAA, GDPR) before storage or transmission
  • Exam Papers — Lock exam PDFs with a password released only at exam time
  • IP Protection — Restrict copying from proprietary documents while allowing viewing

Permissions

Permission Description
print Allow printing
print_highres Allow high-res printing
copy Allow copying text
modify Allow modifying content
annotate Allow adding annotations
fill_forms Allow filling form fields
extract Allow extracting content
assemble Allow assembling pages

Example Usage

curl -X POST https://pdfapihub.com/api/v1/lockPdf \
  -H "CLIENT-API-KEY: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://pdfapihub.com/sample.pdf",
    "password": "viewerPass",
    "owner_password": "adminPass",
    "permissions": { "print": true, "copy": false, "modify": false },
    "output": "url"
  }'