public bool StartMeetingFromClient(IRoom room, string uniqueId, string signature) { if (!_signatureService.VerifySignature(room, uniqueId, signature)) { __log.ErrorFormat("Invalid signature: {0} for {1}", signature, uniqueId); return(false); } __log.DebugFormat("Starting {0} for {1}", uniqueId, room.Id); _meetingRepository.StartMeeting(room.OrganizationId, uniqueId); BroadcastUpdate(room); return(true); }
/// <summary> /// Validate a document for hospital signature and patient accuracy /// </summary> /// <param name="patient"></param> /// <param name="document"></param> /// <param name="signedMessage"></param> /// <param name="publicKey"></param> /// <returns>DocumentValidationResult</returns> public DocumentValidationResult ValidateDocument(long patientId, Document document, string signedMessage, string publicKey) { var forPateient = document.PatientId == patientId; RSACryptoServiceProvider importedKey = _signatureService.ImportPublicKey(publicKey); var hospitalSigned = _signatureService.VerifySignature(document.ToJson(), signedMessage, importedKey.ExportParameters(false)); return(new DocumentValidationResult(forPateient && hospitalSigned, hospitalSigned, forPateient)); }