Operations (sample payloads)

Main operations

PGP decrypt file

Decrypts a PGP-encrypted file. Sample Input

{
    "keys": \{
        "private_key": "-----BEGIN PGP PRIVATE KEY BLOCK-----\n...\n-----END PGP PRIVATE KEY BLOCK-----",
        "passphrase": "mySecurePassphrase123"
    \},
    "file": \{
        "name": "encrypted_document.pgp",
        "url": "https://example.com/files/encrypted_document.pgp",
        "mime_type": "application/pgp-encrypted",
        "expires": 1672531200
    \}
}

Sample Output

{
    "file": \{
        "name": "decrypted_document.txt",
        "url": "https://example.com/files/decrypted_document.txt",
        "mime_type": "text/plain",
        "expires": 1672617600
    \}
}

PGP encrypt file

Encrypts a file into PGP-armored format. Sample Input

{
    "keys": {
        "public_key": "-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: OpenPGP.js v4.10.10\nComment: https://openpgpjs.org\n\nxjMEYBVkaxYJKwYBBAHaRw8BAQdAZ3Nz8VX9qQQYVqx+X+mT9SvxDMElf0Wy\nTK5SFhjNnynNGVRyYXkgVXNlciA8dHJheUB0cmF5LmlvPsKPBBAWCgAgBQJg\nFWRrBgsJBwgDAgQVCAoCBBYCAQACGQECGwMCHgEAIQkQZ9E6ES8RXvMWIQTp\nq7xfYg1Pq3Bo2+Nn0ToRLxFe8+TmAP9sauJsKsT+QyHH5SS7w8iVJGa72W3q\ngjctRQXNZ+pXwgEAqLYLomtviKfBUOLs+rP/k37TQyBgM5DgXj9RgK85Agc=\n=OKSM\n-----END PGP PUBLIC KEY BLOCK-----"
    },
    "file": \{
        "name": "sensitive_data.txt",
        "url": "https://example.com/files/sensitive_data.txt",
        "mime_type": "text/plain"
    \}
}

Sample Output

{
    "file": \{
        "name": "sensitive_data.txt.pgp",
        "url": "https://example.com/files/sensitive_data.txt.pgp",
        "mime_type": "application/pgp-encrypted",
        "expires": 1623456789
    \}
}

Was this page helpful?