fix:IdentifyManager sqlite重写

todo: 更新identity中的lock与unlock
This commit is contained in:
ChessNineeee
2021-04-10 16:27:34 +08:00
parent cca446b901
commit bcd906e1a2
5 changed files with 120 additions and 57 deletions
+18 -1
View File
@@ -11,7 +11,13 @@ import packet.Data;
import packet.Interest;
import packet.MINPacket;
import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import java.lang.reflect.Array;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.util.IdentityHashMap;
/*
@@ -68,6 +74,18 @@ public class KeyChain {
identity.unLock(passwd, identifyManager.getPrivateKeyEncryptionAlgorithm());
} catch (IdentityException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (InvalidKeyException e) {
e.printStackTrace();
} catch (NoSuchPaddingException e) {
e.printStackTrace();
} catch (BadPaddingException e) {
e.printStackTrace();
} catch (NoSuchProviderException e) {
e.printStackTrace();
} catch (IllegalBlockSizeException e) {
e.printStackTrace();
}
}
@@ -106,7 +124,6 @@ public class KeyChain {
}
//TODO: packet类暂未完成
private byte[] getIdentifierAndReadOnlyValueFromPacket(MINPacket packet) throws Exception{
Block iBlock = new SelfEncodingBase().selfWireEncode(packet.identifierField);
Block rBlock = new SelfEncodingBase().selfWireEncode(packet.readOnlyField);