Compare commits
No commits in common. "98de345c5fc58951246595afcea90b0bc158cf70" and "b73d9b0aacc1ec4e3d56d2c04b91afa4f6e39c4f" have entirely different histories.
98de345c5f
...
b73d9b0aac
@ -7,7 +7,7 @@
|
||||
"linux": "bun build.js && bun build ./src/index.js --compile --bytecode --minify --target=bun-linux-x64-baseline --outfile=./dist/linux/kit",
|
||||
"windows": "bun build.js && bun build ./src/index.js --compile --bytecode --minify --target=bun-windows-x64-baseline --outfile=./dist/windows/kit.exe",
|
||||
"pkg-alpine": "bun build.js && pkg --compress GZip . -t node14-alpine-arm64 -o ./dist/alpine/kit",
|
||||
"pkg-windows": "bun build.js && pkg --compress GZip . -t node14-windows-x64 -o ./dist/windows/kit.exe",
|
||||
"pkg-windows": "bun build.js && pkg --compress GZip . -t win -o ./dist/windows/kit.exe",
|
||||
"pkg-arm64": "bun build.js && pkg --compress GZip . -t node14-linux-arm64 -o ./dist/linux/kit",
|
||||
"pkg-linux": "bun build.js && pkg --compress GZip . -t node14-linux-x64 -o ./dist/linux/kit"
|
||||
},
|
||||
|
||||
@ -1 +0,0 @@
|
||||
node push.js windows D:\\SynologyDrive\\bin
|
||||
@ -331,39 +331,6 @@ parser.addCmdLine("sm4de3 <key> <data>", "sm4 解密,密钥通过 sm3 制备;"
|
||||
$logger.info( out );
|
||||
});
|
||||
|
||||
|
||||
parser.addCmdLine("pkcs7verify <sign> <data>", "验证 pkCS7 签名;", function (cli) {
|
||||
const {verifyPKCS7} = require("./crypto");
|
||||
let sign = cli.getParamValue("sign")
|
||||
let data = cli.getParamValue("data")
|
||||
let out = verifyPKCS7( sign, data )
|
||||
if ( out ) {
|
||||
$logger.info("验证通过")
|
||||
} else {
|
||||
$logger.error("验证不通过")
|
||||
}
|
||||
});
|
||||
|
||||
parser.addCmdLine("pkcs7info <sign>", "从 pkCS7 签名中提取信息(证书、公钥、签名);", function (cli) {
|
||||
const {getInfoFromPKCS7} = require("./crypto");
|
||||
let sign = cli.getParamValue("sign")
|
||||
let out = getInfoFromPKCS7( sign )
|
||||
$logger.info(' cert:');
|
||||
$logger.info(' subject:', result.cert?.subjectDN);
|
||||
$logger.info(' issuer:', result.cert?.issuerDN);
|
||||
$logger.info(' serialNumber:', result.cert?.serialNumber);
|
||||
$logger.info(' notBefore:', result.cert?.notBefore);
|
||||
$logger.info(' notAfter:', result.cert?.notAfter);
|
||||
$logger.info(' pem:');
|
||||
$logger.info(result.cert?.pem);
|
||||
$logger.info(' publicKey:');
|
||||
$logger.info(result.publicKey);
|
||||
$logger.info(' publicKey (hex):');
|
||||
$logger.info(result.publicKeyHex);
|
||||
$logger.info(' signature (hex):');
|
||||
$logger.info(result.signatureHex);
|
||||
});
|
||||
|
||||
// parser.addCmdLine("base64 <-en/-de> <data>", "base64 编解码", function (cli) {
|
||||
parser.addCmdLine("base64 [-en] [-de] [-hex] <data>", "base64 编解码;", function (cli) {
|
||||
let data = cli.getParamValue("data")
|
||||
|
||||
@ -109,9 +109,6 @@ X9ncPP4VRERPw8U=
|
||||
const mockOriginalData = 'This is the test content for PKCS7 signature.';
|
||||
const result = crypto.verifyPKCS7(mockP7Sign, mockOriginalData);
|
||||
console.log('测试结果:', result);
|
||||
if( !result ) {
|
||||
throw new Error("验签不通过")
|
||||
}
|
||||
console.log('✓ verifyPKCS7 接口(RSA)测试通过');
|
||||
} catch (error) {
|
||||
console.error('✗ verifyPKCS7 接口(RSA)测试失败:', error.message);
|
||||
@ -127,9 +124,6 @@ try {
|
||||
const mockOriginalData = 'QDJNHHVB_FWQ';
|
||||
const result = crypto.verifyPKCS7(mockP7Sign, mockOriginalData);
|
||||
console.log('测试结果:', result);
|
||||
if( !result ) {
|
||||
throw new Error("验签不通过")
|
||||
}
|
||||
console.log('✓ verifyPKCS7 接口(SM2)测试通过');
|
||||
} catch (error) {
|
||||
console.error('✗ verifyPKCS7 接口(SM2)测试失败:', error.message);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user