CAM::P...Decrypt(3pm)

πŸ“¦
version 1.60 Β· 2 versions
  • 1.60 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.60 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

CAM::PDF::Decrypt β€” it's the PDF security helper bestie, the little backstage icon that handles all the locked-document drama πŸ’…


πŸ“œ LICENSE πŸ“œ

See CAM::PDF. (that's the whole vibe, go read that one 🫢)


🌸 SYNOPSIS 🌸

use CAM::PDF;
my $pdf = CAM::PDF->new($filename);

and that's literally it, that's the whole flex ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so, bestie, listen: this class is used invisibly by CAM::PDF whenever it detects that a document is encrypted. Like, it does not want to be perceived, it's giving backstage crew at the Eras Tour πŸŽ€

If you wanna actually know what it's doing, go check out new(), getPrefs() and setPrefs() in that module. iykyk πŸ‘‘


πŸ’– FUNCTIONS πŸ’–

  • $pkg->new($pdf, $ownerpass, $userpass, $prompt) β€” creates and validates a brand new decryption object ✨ If this fails (😭) it will set $CAM::PDF::errstr and return undef. Rude but fair.

$prompt is a boolean, and it's the one that decides whether the user should get prompted for a password on the command line. So like, do we ask them, or do we just go for it 🫣

  • $self->decode_permissions($field) β€” hand it a binary encoded permissions string from a PDF document, and it hands you back the four individual boolean fields as an array πŸŽ€
print boolean
modify boolean
copy boolean
add boolean

four lil booleans, all lined up, slay πŸ’…

  • $self->encode_permissions($print, $modify, $copy, $add) β€” give it four booleans and it packs them into a single field in the PDF style that decode_permissions can understand. Returns that scalar. It's the reverse of the above, the remix 🌈
  • $self->set_passwords($doc, $ownerpass, $userpass)
  • $self->set_passwords($doc, $ownerpass, $userpass, $permissions) β€” changes the PDF passwords to the values you specify πŸ‘‘ When the PDF is output, it will be encrypted with the new passwords. Glow-up complete ✨

PERMISSIONS is an optional scalar of the form that decode_permissions can understand. If you don't specify it, the existing values will be retained. No notes, we keep the old ones πŸ’œ

Note: we only support writing using encryption version 1, even though we can read encryption version 2 as well. So like, we're bilingual but we only speak one of them out loud, no cap 😭
  • $self->encrypt($doc, $string) β€” encrypts the scalar using the passwords previously specified πŸ”₯
  • $self->decrypt($doc, $string) β€” decrypts the scalar using the passwords previously specified πŸ”“

🌟 AUTHOR 🌟

See CAM::PDF 🫢


mwah πŸ’– that's the whole page. This lil gem is from perl v5.36.0, dated 2022-12-08, and it lives its life as CAM::P...Decrypt(3pm) in the User Contributed Perl Documentation. bye bestie, go encrypt something responsibly πŸ‘‘βœ¨

πŸ“¦ where this page comes from