+
+ public static byte[] getGroupId(GroupMasterKey groupMasterKey) {
+ final GroupSecretParams groupSecretParams = GroupSecretParams.deriveFromMasterKey(groupMasterKey);
+ return groupSecretParams.getPublicParams().getGroupIdentifier().serialize();
+ }
+
+ public static GroupMasterKey deriveV2MigrationMasterKey(byte[] groupId) {
+ try {
+ return new GroupMasterKey(new HKDFv3().deriveSecrets(groupId,
+ "GV2 Migration".getBytes(),
+ GroupMasterKey.SIZE));
+ } catch (InvalidInputException e) {
+ throw new AssertionError(e);
+ }
+ }