AP Actorの鍵とkeyIdのフォーマットの変更 (#5733)

* Node PKCS#8

* keyIdを#main-key形式に
This commit is contained in:
MeiMei
2020-01-20 04:51:44 +09:00
committed by syuilo
parent 5a950cf991
commit 46aaf8fa9a
4 changed files with 14 additions and 10 deletions

View File

@ -91,21 +91,21 @@ export default async (ctx: Koa.Context) => {
return;
}
const keyPair = await new Promise<string[]>((s, j) =>
const keyPair = await new Promise<string[]>((res, rej) =>
generateKeyPair('rsa', {
modulusLength: 4096,
publicKeyEncoding: {
type: 'pkcs1',
type: 'spki',
format: 'pem'
},
privateKeyEncoding: {
type: 'pkcs1',
type: 'pkcs8',
format: 'pem',
cipher: undefined,
passphrase: undefined
}
} as any, (e, publicKey, privateKey) =>
e ? j(e) : s([publicKey, privateKey])
} as any, (err, publicKey, privateKey) =>
err ? rej(err) : res([publicKey, privateKey])
));
let account!: User;