13 lines
342 B
TypeScript
13 lines
342 B
TypeScript
'use strict';
|
|
// @ts-ignore
|
|
import RSA from 'node-rsa';
|
|
|
|
/**
|
|
* Create a private key for a kintone plugin
|
|
* Copy from https://github.com/kintone/js-sdk/blob/main/packages/create-plugin/src/privateKey.ts
|
|
*/
|
|
export const generatePrivateKey = () => {
|
|
const key = new RSA({ b: 1024 });
|
|
return key.exportKey('pkcs1-private');
|
|
};
|