本文整理汇总了Java中com.beowulfe.hap.HomekitServer.generateKey方法的典型用法代码示例。如果您正苦于以下问题:Java HomekitServer.generateKey方法的具体用法?Java HomekitServer.generateKey怎么用?Java HomekitServer.generateKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.beowulfe.hap.HomekitServer
的用法示例。
在下文中一共展示了HomekitServer.generateKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: MockAuthInfoService
import com.beowulfe.hap.HomekitServer; //导入方法依赖的package包/类
public MockAuthInfoService() throws InvalidAlgorithmParameterException {
Properties props = new Properties();
try {
InputStream resourceAsStream = new FileInputStream(new File(HOME_HAP+"server.properties"));
if (resourceAsStream != null) {
props.load(resourceAsStream);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (props.getProperty("mac") != null) {
System.out.println("using existing config");
mac = props.getProperty("mac");
salt = new BigInteger(Base64.decodeBase64((String) props.get("salt")));
privateKey = readKey("privateKey");
System.out.println(new String(privateKey));
System.out.println(mac);
System.out.println(salt);
} else {
System.out.println("generating new config");
mac = HomekitServer.generateMac();
salt = HomekitServer.generateSalt();
privateKey = HomekitServer.generateKey();
System.out.println("SALT: " + salt);
System.out.println("KEY: " + new String(privateKey));
saveParamChanges(mac, salt, privateKey);
saveKey("privateKey", privateKey);
}
System.out.println(
"Auth info is generated each time the sample application is started. Pairings are not persisted.");
System.out.println("The PIN for pairing is " + PIN);
}
开发者ID:comdata,项目名称:HomeAutomation,代码行数:42,代码来源:MockAuthInfoService.java示例2: AuthInfoService
import com.beowulfe.hap.HomekitServer; //导入方法依赖的package包/类
public AuthInfoService() throws InvalidAlgorithmParameterException {
Properties props = new Properties();
try {
InputStream resourceAsStream = new FileInputStream(new File("/home/hap/" + "server.properties"));
if (resourceAsStream != null) {
props.load(resourceAsStream);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (props.getProperty("mac") != null) {
System.out.println("using existing config");
mac = props.getProperty("mac");
salt = new BigInteger(Base64.decodeBase64((String) props.get("salt")));
privateKey = readKey("privateKey");
System.out.println(new String(privateKey));
System.out.println(mac);
System.out.println(salt);
loadUsers();
} else {
System.out.println("generating new config");
mac = "04:a1:51:69:94:55";// HomekitServer.generateMac();
salt = HomekitServer.generateSalt();
privateKey = HomekitServer.generateKey();
System.out.println("SALT: " + salt);
System.out.println("KEY: " + new String(privateKey));
saveParamChanges(mac, salt, privateKey);
saveKey("privateKey", privateKey);
}
System.out.println(
"Auth info is generated each time the sample application is started. Pairings are not persisted.");
System.out.println("The PIN for pairing is " + PIN);
}
开发者ID:comdata,项目名称:HomeAutomation,代码行数:44,代码来源:AuthInfoService.java本文标签属性:
示例:示例志愿表
代码:代码编程
java:java自行车
HomekitServer:HomekitServer
generateKey:generateKey