This commit is contained in:
@ -2,6 +2,7 @@ import { PNG } from 'pngjs'
|
||||
import fs from 'fs'
|
||||
import { createHash, createPrivateKey, createSign } from 'crypto'
|
||||
import { config } from './config.js'
|
||||
import { server } from './index.js'
|
||||
|
||||
export const ImageSecurity = {
|
||||
createImageHash: async (path, isCape) => {
|
||||
@ -70,7 +71,7 @@ export const ImageSecurity = {
|
||||
throw new Error('Invalid image size')
|
||||
},
|
||||
sign: async (data) => {
|
||||
return createSign('RSA-SHA1').update(data).sign(createPrivateKey(config.privateKey), 'hex')
|
||||
return createSign('RSA-SHA1').update(data).sign({ key: createPrivateKey(server.keys.privateKey) }, 'hex')
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user