(MLSMessage ct)
| 1224 | } |
| 1225 | |
| 1226 | public byte[][] unprotect(MLSMessage ct) |
| 1227 | throws Exception |
| 1228 | { |
| 1229 | AuthenticatedContent auth = unprotectToContentAuth(ct); |
| 1230 | if (!verifyAuth(auth)) |
| 1231 | { |
| 1232 | throw new Exception("Message signature failed to verify"); |
| 1233 | } |
| 1234 | |
| 1235 | if (auth.getContent().getContentType() != ContentType.APPLICATION) |
| 1236 | { |
| 1237 | throw new Exception("Unprotected of handshake message"); |
| 1238 | } |
| 1239 | |
| 1240 | if (auth.getWireFormat() != WireFormat.mls_private_message) |
| 1241 | { |
| 1242 | throw new Exception("Application data not sent as PrivateMessage"); |
| 1243 | } |
| 1244 | byte[][] authAndContent = new byte[2][]; |
| 1245 | authAndContent[0] = auth.getContent().getAuthenticated_data(); |
| 1246 | authAndContent[1] = auth.getContent().getContentBytes(); |
| 1247 | return authAndContent; |
| 1248 | } |
| 1249 | |
| 1250 | private boolean verifyAuth(AuthenticatedContent auth) |
| 1251 | throws Exception |
no test coverage detected