iceshrimp/src/common/remote/activitypub/renderer/key.ts

10 lines
319 B
TypeScript
Raw Normal View History

2018-04-01 19:18:36 +09:00
import config from '../../../../conf';
import { extractPublic } from '../../../../crypto_key';
import { ILocalAccount } from '../../../../models/user';
export default ({ username, account }) => ({
type: 'Key',
owner: `${config.url}/@${username}`,
publicKeyPem: extractPublic((account as ILocalAccount).keypair)
});