Add crypto.js for all things crypto.
This commit is contained in:
parent
d978a5d466
commit
f784bd8da3
1 changed files with 21 additions and 0 deletions
21
lib/make/crypto.js
Normal file
21
lib/make/crypto.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
make.crypto = {
|
||||
keygenAlgorithm: () => {
|
||||
const keygenAlgorithms = [
|
||||
{
|
||||
name: 'ECDSA',
|
||||
namedCurve: 'P-256'
|
||||
},
|
||||
{
|
||||
name: 'RSASSA-PKCS1-v1_5',
|
||||
hash: 'SHA-256',
|
||||
modulusLength: 2048,
|
||||
publicExponent: new Uint8Array([1, 0, 1])
|
||||
}
|
||||
]
|
||||
return random.pick(keygenAlgorithms)
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue