use of com.google.u2f.key.messages.RegisterRequest in project OpenUnison by TremoloSecurity.
the class RawMessageCodec method decodeRegisterRequest.
public static RegisterRequest decodeRegisterRequest(byte[] data) throws U2FException {
try {
DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(data));
byte[] appIdSha256 = new byte[32];
byte[] challengeSha256 = new byte[32];
inputStream.readFully(challengeSha256);
inputStream.readFully(appIdSha256);
if (inputStream.available() != 0) {
throw new U2FException("Message ends with unexpected data");
}
return new RegisterRequest(appIdSha256, challengeSha256);
} catch (IOException e) {
throw new U2FException("Error when parsing raw RegisterRequest", e);
}
}
Aggregations