()
| 31 | } |
| 32 | |
| 33 | @Override |
| 34 | public Integer call() throws Exception { |
| 35 | SignalProtocolLoggerProvider.initializeLogging(SignalProtocolLogger.INFO); |
| 36 | SignalProtocolLoggerProvider.setProvider( |
| 37 | new SignalProtocolLogger() { |
| 38 | public void log(int priority, String tag, String message) { |
| 39 | System.err.println(priority + " " + message); |
| 40 | } |
| 41 | }); |
| 42 | |
| 43 | byte[] hmacKey = Hex.fromStringCondensed(this.hmacKey); |
| 44 | byte[] aesKey = Hex.fromStringCondensed(this.aesKey); |
| 45 | var backupKey = MessageBackupKey.fromParts(hmacKey, aesKey); |
| 46 | |
| 47 | MessageBackup.ValidationResult result = |
| 48 | MessageBackup.validate( |
| 49 | backupKey, |
| 50 | MessageBackup.Purpose.REMOTE_BACKUP, |
| 51 | () -> { |
| 52 | try { |
| 53 | return new FileInputStream(input); |
| 54 | } catch (FileNotFoundException e) { |
| 55 | throw new AssertionError(e); |
| 56 | } |
| 57 | }, |
| 58 | input.length()); |
| 59 | return result.unknownFieldMessages.length == 0 ? 0 : 1; |
| 60 | } |
| 61 | } |
no test coverage detected