yumechi-no-kuni/src/common/remote/activitypub/renderer/key.ts
2018-04-02 04:01:34 +09:00

10 lines
352 B
TypeScript

import config from '../../../../conf';
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.account.keypair)
});