NFC 切换规范中有一个示例 - 如何将 WPC 配置写入 WIFI 标签。
有一个记录条目用于加密。
因此,如果我想为 WIFI-Config 存储加密,有两点我感兴趣: TKIP、CCMP
我可以存储这些信息,但我不知道通过阅读这些信息,如果这是指 GroupCipher 或 PairwiseCipher 或两者?
所以我可以这样设置:
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
和
config.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
config.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
但是我什么时候为 Pairwise AND/OR GroupCipher 设置 TKIP、CCMP。
我总是同时设置两者吗?另外,如果我不知道标签上的加密是指 Group 还是 Pairwise?
我希望你明白我的意思,如果我现在从标签中读取 AES,我是否设置
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
或
config.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
或
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
config.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
最佳答案
如果你想连接到 WPA(1) AP,那么你必须使用 TKIP。对于 WPA2 AP,您需要 CCMP。
现在,如果您想同时使用(WPA(1) 和 WPA2 AP),则必须同时设置。
您应该对 PairWise 和 GroupWise key 使用相同的机制 (TKIP/CCMP)。
Pairwise Cipher key用于单播消息,GroupCipher key用于广播。
希望对您有所帮助,
关于android - NFC交接WIFI+加密,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9906063/