MCPcopy Index your code
hub / github.com/bcgit/bc-java / unprotect

Method unprotect

mls/src/main/java/org/bouncycastle/mls/protocol/Group.java:1226–1248  ·  view source on GitHub ↗
(MLSMessage ct)

Source from the content-addressed store, hash-verified

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

Callers 3

unprotectImplMethod · 0.95
handleMethod · 0.45

Calls 7

verifyAuthMethod · 0.95
getContentMethod · 0.95
getWireFormatMethod · 0.95
getAuthenticated_dataMethod · 0.80
getContentBytesMethod · 0.80
getContentTypeMethod · 0.65

Tested by

no test coverage detected