5.0.0-alpha.15 • Published 2 years ago
@authing/miniprogram-sm2encrypt v5.0.0-alpha.15
@authing/miniprogram-sm2encrypt
JavaScript sm2 encrypt module for miniprogram
Usage
Use in Authing miniprogram SDK
import { Authing } from '@authing/miniprogram-wx'
import { encryptFunction } from '@authing/miniprogram-sm2encrypt'
const authing = new Authing({
appId: '630b549efa97ba795338e2cd',
host: 'http://localhost:3000',
userPoolId: '630b549d5a697473a2d7fa20',
encryptFunction
})
Use alone
import { encryptFunction } from '@authing/miniprogram-sm2encrypt'
export async function getPublicKey () {
const host = 'https://core.authing.cn'
const api = `${host}/api/v3/system`
const res = await axios.get(api)
return res.data.data.sm2.publicKey
}
const publicKey = await getPublicKey()
encryptFunction('this is planText', publicKey)
5.0.0-alpha.24
2 years ago
5.0.0-alpha.23
2 years ago
5.0.0-alpha.22
2 years ago
5.0.0-alpha.21
2 years ago
5.0.0-alpha.20
2 years ago
5.0.0-alpha.19
2 years ago
5.0.0-alpha.18
2 years ago
5.0.0-alpha.17
2 years ago
5.0.0-alpha.16
2 years ago
5.0.0-alpha.15
2 years ago