]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/peertube-crypto.ts
Move models to typescript-sequelize
[github/Chocobozzz/PeerTube.git] / server / helpers / peertube-crypto.ts
index 74e4cc703b3641de211adcab14ff7cd47e30ab7f..c4c735cb84f6517b6ed4e3cb525c06bf25d01807 100644 (file)
@@ -1,5 +1,5 @@
 import { BCRYPT_SALT_SIZE, PRIVATE_RSA_KEY_SIZE } from '../initializers'
-import { AccountInstance } from '../models/account/account-interface'
+import { AccountModel } from '../models/account/account'
 import { bcryptComparePromise, bcryptGenSaltPromise, bcryptHashPromise, createPrivateKey, getPublicKey } from './core-utils'
 import { jsig } from './custom-jsonld-signature'
 import { logger } from './logger'
@@ -13,7 +13,7 @@ async function createPrivateAndPublicKeys () {
   return { privateKey: key, publicKey }
 }
 
-function isSignatureVerified (fromAccount: AccountInstance, signedDocument: object) {
+function isSignatureVerified (fromAccount: AccountModel, signedDocument: object) {
   const publicKeyObject = {
     '@context': jsig.SECURITY_CONTEXT_URL,
     '@id': fromAccount.url,
@@ -40,7 +40,7 @@ function isSignatureVerified (fromAccount: AccountInstance, signedDocument: obje
     })
 }
 
-function signObject (byAccount: AccountInstance, data: any) {
+function signObject (byAccount: AccountModel, data: any) {
   const options = {
     privateKeyPem: byAccount.privateKey,
     creator: byAccount.url