aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/peertube-crypto.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/peertube-crypto.ts')
-rw-r--r--server/helpers/peertube-crypto.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/helpers/peertube-crypto.ts b/server/helpers/peertube-crypto.ts
index 74e4cc703..c4c735cb8 100644
--- a/server/helpers/peertube-crypto.ts
+++ b/server/helpers/peertube-crypto.ts
@@ -1,5 +1,5 @@
1import { BCRYPT_SALT_SIZE, PRIVATE_RSA_KEY_SIZE } from '../initializers' 1import { BCRYPT_SALT_SIZE, PRIVATE_RSA_KEY_SIZE } from '../initializers'
2import { AccountInstance } from '../models/account/account-interface' 2import { AccountModel } from '../models/account/account'
3import { bcryptComparePromise, bcryptGenSaltPromise, bcryptHashPromise, createPrivateKey, getPublicKey } from './core-utils' 3import { bcryptComparePromise, bcryptGenSaltPromise, bcryptHashPromise, createPrivateKey, getPublicKey } from './core-utils'
4import { jsig } from './custom-jsonld-signature' 4import { jsig } from './custom-jsonld-signature'
5import { logger } from './logger' 5import { logger } from './logger'
@@ -13,7 +13,7 @@ async function createPrivateAndPublicKeys () {
13 return { privateKey: key, publicKey } 13 return { privateKey: key, publicKey }
14} 14}
15 15
16function isSignatureVerified (fromAccount: AccountInstance, signedDocument: object) { 16function isSignatureVerified (fromAccount: AccountModel, signedDocument: object) {
17 const publicKeyObject = { 17 const publicKeyObject = {
18 '@context': jsig.SECURITY_CONTEXT_URL, 18 '@context': jsig.SECURITY_CONTEXT_URL,
19 '@id': fromAccount.url, 19 '@id': fromAccount.url,
@@ -40,7 +40,7 @@ function isSignatureVerified (fromAccount: AccountInstance, signedDocument: obje
40 }) 40 })
41} 41}
42 42
43function signObject (byAccount: AccountInstance, data: any) { 43function signObject (byAccount: AccountModel, data: any) {
44 const options = { 44 const options = {
45 privateKeyPem: byAccount.privateKey, 45 privateKeyPem: byAccount.privateKey,
46 creator: byAccount.url 46 creator: byAccount.url