应用管理

This commit is contained in:
liulu
2024-11-01 15:51:47 +08:00
parent b5df4c2406
commit c82f7d8013
12 changed files with 296 additions and 42 deletions
@@ -42,15 +42,11 @@ public class BCSdfApiService implements SdfApiService {
BCECPrivateKey priKey = (BCECPrivateKey) keyPair.getPrivate();
byte[] x = pubKey.getQ().getXCoord().getEncoded();
byte[] y = pubKey.getQ().getYCoord().getEncoded();
byte[] d = BigIntegers.asUnsignedByteArray(64, priKey.getD());
byte[] d = BigIntegers.asUnsignedByteArray(32, priKey.getD());
return new EccKey(new EccPubKey(256, x, y), new EccPriKey(256, d));
}
@Override
public EccKey genEccKeyPairAndEncByKek() {
return null;
}
@Override
public byte[] calculateMAC(byte[] symKey, byte[] pucIv, byte[] pucData) {
@@ -75,12 +71,12 @@ public class BCSdfApiService implements SdfApiService {
}
@Override
public byte[] encryptByMKNoPadding(byte[] data) {
public byte[] encryptByMK(byte[] data) {
return data;
}
@Override
public byte[] decryptByMKNoPadding(byte[] data) {
public byte[] decryptByMK(byte[] data) {
return data;
}
@@ -25,14 +25,6 @@ public interface SdfApiService {
*/
EccKey genKeyPairEcc();
/**
* 产生ECC加密密钥对并使用kek加密私钥输出
*
* @return pubKey 返回公钥 | priKey 返回私钥
*/
EccKey genEccKeyPairAndEncByKek();
/**
* 计算MAC
*
@@ -46,15 +38,14 @@ public interface SdfApiService {
byte[] hmac(byte[] key, byte[] srcData);
/**
* 多包杂凑运算
* 杂凑运算
*
* @param pucData 缓冲区指针,用于存放输入的数据明文
* @return hash值
*/
byte[] hash(byte[] pucData);
byte[] encryptByMK(byte[] data);
byte[] encryptByMKNoPadding(byte[] data);
byte[] decryptByMKNoPadding(byte[] data);
byte[] decryptByMK(byte[] data);
}