示例#1
0
    /// <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;
        }
    }
示例#2
0
    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;
    }
示例#3
0
 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;
     }
 }
示例#4
0
 /// <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;
 }
示例#5
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);
 }