View Source ActivityPub.Safety.Keys (Bonfire v0.9.11-social-beta.6)

Handles RSA keys for Actors & helpers for HTTP signatures

Summary

Functions

add_public_key(actor, generate_if_missing \\ true)

cast_uri(object)

ensure_keys_present(object)

Checks if an actor struct has a non-nil keys field and generates a PEM if it doesn't.

fetch_public_key_for_ap_id(ap_id)

Fetches the remote public key for given actor AP ID.

generate_rsa_pem()

get_public_key_for_ap_id(ap_id)

Get the public key for given actor AP ID.

http_host(map)

key_id_to_actor_id(key_id)

keypair_from_pem(pem)

maybe_add_fetch_signature_headers(headers, id, date \\ nil)

public_key_decode(public_key_pem)

public_key_from_data(actor)

sign(actor, headers)