Commit 155e2bc0 authored by Frauke's avatar Frauke

Added function for signing the noce

parent 84266c22
......@@ -16,6 +16,19 @@ gulp.task('js:bundle', () => {
.pipe(gulp.dest('./public/js'))
})
gulp.task('js:bundlescript', () => {
browserify({
entries: 'src/js/script.js',
debug: true
})
.bundle()
.pipe(source('src/js/script.js'))
.pipe(rename({
dirname: ''
}))
.pipe(gulp.dest('./public/js'))
})
gulp.task('watch', () =>
gulp.watch('./src/**/*.js', ['js:bundle'])
gulp.watch('./src/**/*.js', ['js:bundle', 'js:bundlescript'])
)
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -21,7 +21,14 @@ form.addEventListener('submit', (e) => {
return Promise.all([privateKey, nonce])
}).then((values) => {
const decryptedPrivateKey = values[0]
const nonce = values[1].data.nonce
const nonce = new Uint16Array(values[1].data.nonce.data).buffer
// TODO: create new keys for signing purpose and sign the nonce with this key
// crypto.subtle.sign('RSASSA-PKCS1-v1_5', key, nonce).then((signedNonce) => {
// console.log(signedNonce)
// }).catch((err) => {
// console.log(err)
// })
// Export key as an arraybuffer to import later as unextractable private key.
crypto.subtle.exportKey('pkcs8', decryptedPrivateKey).then((exportedPrivateKey) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment