summaryrefslogtreecommitdiff
path: root/src/remote/activitypub/renderer/key.ts
blob: 0d5e52557c2da519eeed2fb01044382fd4d24c52 (plain)
1
2
3
4
5
6
7
8
9
10
import config from '../../../config';
import { extractPublic } from '../../../crypto_key';
import { ILocalUser } from '../../../models/user';

export default (user: ILocalUser) => ({
	id: `${config.url}/users/${user._id}/publickey`,
	type: 'Key',
	owner: `${config.url}/users/${user._id}`,
	publicKeyPem: extractPublic(user.keypair)
});