View Source ActivityPub.Safety.Encryption (Bonfire v0.9.10-classic-beta.169)

Provides encryption and decryption functionality using RSA keys managed by ActivityPub.Safety.Keys.

NOTE: not used at the moment, simply intended as a proof-of-concept

Summary

Functions

Decrypts data for a given actor using their private key.

Encrypts data for a given actor using their public key.

Functions

Link to this function

decrypt(encrypted_data, actor)

View Source

Decrypts data for a given actor using their private key.

Parameters

  • encrypted_data: The data to decrypt (binary)
  • actor: The Actor struct with private keys

Returns

  • on success
  • on failure

Encrypts data for a given actor using their public key.

Parameters

  • data: The data to encrypt (binary or string)
  • actor: The Actor struct or AP ID of the recipient

Returns

  • on success
  • on failure