sdf 接口
This commit is contained in:
@@ -278,14 +278,14 @@ public class KeyInfoServiceImpl implements KeyInfoService {
|
||||
|
||||
if (KeyCategory.SYM_KEY.getCode().equals(info.getKeyType())) {
|
||||
byte[] symKey = sdfApiService.generateRandom(16);
|
||||
byte[] encSymKey = sdfApiService.encryptByMK(symKey);
|
||||
byte[] encSymKey = sdfApiService.encryptByTMK(symKey);
|
||||
record.setKeyData(Hex.toHexString(encSymKey));
|
||||
String checkHash = Hex.toHexString(sdfApiService.hash(symKey));
|
||||
record.setCheckValue(checkHash);
|
||||
} else {
|
||||
EccKey eccKey = sdfApiService.genKeyPairEcc();
|
||||
byte[] d = eccKey.getPriKey().getD();
|
||||
byte[] encD = sdfApiService.encryptByMK(d);
|
||||
byte[] encD = sdfApiService.encryptByTMK(d);
|
||||
record.setKeyData(Hex.toHexString(encD));
|
||||
String checkHash = Hex.toHexString(sdfApiService.hash(d));
|
||||
record.setCheckValue(checkHash);
|
||||
@@ -392,7 +392,7 @@ public class KeyInfoServiceImpl implements KeyInfoService {
|
||||
byte[] y = Arrays.copyOfRange(xy, 32, 64);
|
||||
ECPublicKeyParameters pubKeyParam = BCECUtils.createECPublicKeyParameters(x, y);
|
||||
|
||||
byte[] priKeyBytes = sdfApiService.decryptByMK(Hex.decode(record.getKeyData()));
|
||||
byte[] priKeyBytes = sdfApiService.decryptByTMK(Hex.decode(record.getKeyData()));
|
||||
// byte[][] pri18 = LangUtils.splitAverage(priKeyBytes);
|
||||
ECPrivateKeyParameters priKeyParam = BCECUtils.createECPrivateKeyParameters(priKeyBytes);
|
||||
ECDomainParameters domainParams = priKeyParam.getParameters();
|
||||
|
||||
Reference in New Issue
Block a user