1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-18 00:29:10 +09:00
misskey/src/remote/activitypub/renderer/key.ts
2018-04-08 15:15:22 +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}/users/${user._id}/publickey`,
type: 'Key',
owner: `${config.url}/users/${user._id}`,
publicKeyPem: extractPublic(user.keypair)
});