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

11 lines
364 B
TypeScript
Raw Normal View History

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