/// <summary> /// Indica che il componente Comped è installato e funzionante /// </summary> /// <returns>bool</returns> public bool IsAlive() { try { CompEdLib p7m = new CompEdLib(); p7m.Dispose(); return true; } catch (Exception e) { return false; } }
public DocumentContent TimeStampDocument(string FileName, DocumentContent Content, bool IsInfoCamereFormat) { DocumentContent newTimeStampDocument = null; CompEdLib p7m = null; try { p7m = new CompEdLib(); newTimeStampDocument = new DocumentContent(p7m.P7xTimeStampDocument(IsInfoCamereFormat, FileName, Content.Blob)); } catch (Exception e) { throw e; } finally { if (p7m != null) p7m.Dispose(); } return newTimeStampDocument; }
public DocumentContent GetContent(string fileName, DocumentContent Content) { try { logger.DebugFormat("GetContent {0}", fileName); using (CompEdLib p7m = new CompEdLib()) { Boolean isP7M = String.Compare("P7M", fileName.Substring(fileName.Length - 3), true) == 0; String MetaData; DocumentContent result = new DocumentContent(p7m.GetContent(isP7M, Content.Blob, out MetaData)); //Ritorniamo un Xml nel campo Description per permettere future integrazioni di tag XML //Sono informazioni che spesso non ci sono. result.Description = MetaData; return result; } } catch (Exception ex) { logger.Error(ex); throw; } }
/// <summary> /// ritorna true se il documentcontent è firmato /// </summary> /// <param name="content"></param> /// <returns></returns> public bool IsBlobSigned(DocumentContent content) { CompEdLib p7m = new CompEdLib(); return p7m.GetSignatureCount(content.Blob) > 0; }
/// <summary> /// Torna quante marche temporali hai a disposizione come stringa contentente il file XML /// </summary> /// <param name="Service"></param> /// <param name="User"></param> /// <param name="Password"></param> /// <returns>string</returns> public string GetTimeStampAvailable(string Service, string User, string Password) { return CompEdLib.GetTimeStampCount(Service, User, Password); }