Signature: keyId="https://yourdomain.com/actor#main-key",algorithm="rsa-sha256",headers="(request-target) host date digest",signature="base64signature"
Key Discovery
ActivityPub servers can verify signatures by:
Extracting keyId from signature header
Fetching your actor document at /actor
Using the publicKey.publicKeyPem field to verify the signature
๐งช Testing Tools
You have several tools to verify everything is working:
1. HTTP Signatures Test (/test-http-signatures.ts)
Tests key loading and signature creation
Validates environment variables
Shows detailed signature information
2. Key Generator (/generate-keys.ts)
Generates new RSA key pairs
Provides copy-paste environment variables
Includes security instructions
3. ActivityPub Actor (/actor)
Shows your actor document with real public key
Content negotiation for application/activity+json
Used by other servers for key verification
๐ Signature Example
Here's what your signatures look like:
POST /inbox HTTP/1.1
Host: mastodon.social
Date: Fri, 11 Jul 2025 11:27:41 GMT
Content-Type: application/activity+json
Digest: SHA-256=abc123...
Signature: keyId="https://yourdomain.com/actor#main-key",algorithm="rsa-sha256",headers="(request-target) host date digest",signature="VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHNpZ25hdHVyZQ=="
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Create",
"actor": "https://yourdomain.com/actor",
"object": {
"type": "Note",
"content": "Your blog post content"
}
}
๐ Security Features
RSA-2048 keys for strong cryptographic security
SHA-256 hashing for digest and signature algorithms