misskey/src/remote/activitypub/renderer/key.ts
2018-04-08 03:58:11 +09:00

11 lines
337 B
TypeScript

import config from '../../../config';
import { extractPublic } from '../../../crypto_key';
import { ILocalUser } from '../../../models/user';
export default (user: ILocalUser) => ({
id: `${config.url}/@${user.username}/publickey`,
type: 'Key',
owner: `${config.url}/@${user.username}`,
publicKeyPem: extractPublic(user.keypair)
});