AipFileInfo.cs 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. using System;
  2. namespace AipGateway.AIP
  3. {
  4. public class SetFileInfo : IDisposable
  5. {
  6. private bool disposedValue;
  7. public int errorNo { get; set; }
  8. public string errorMsg { get; set; } = string.Empty;
  9. public string labelGuid { get; set; } = string.Empty;
  10. public string templateGuid { get; set; } = string.Empty;
  11. public string fileOwner { get; set; } = string.Empty;
  12. public Int64 fileSize { get; set; }
  13. public string newFileName { get; set; } = string.Empty;
  14. public string newFileOwner { get; set; } = string.Empty;
  15. public string newFileLabelGuid { get; set; } = string.Empty;
  16. public string newFileTemplateGuid { get; set; } = string.Empty;
  17. public Int64 newFileSize { get; set; }
  18. protected virtual void Dispose(bool disposing)
  19. {
  20. if (!disposedValue)
  21. {
  22. if (disposing)
  23. {
  24. // TODO: 관리형 상태(관리형 개체)를 삭제합니다.
  25. }
  26. // TODO: 비관리형 리소스(비관리형 개체)를 해제하고 종료자를 재정의합니다.
  27. // TODO: 큰 필드를 null로 설정합니다.
  28. disposedValue = true;
  29. }
  30. }
  31. // // TODO: 비관리형 리소스를 해제하는 코드가 'Dispose(bool disposing)'에 포함된 경우에만 종료자를 재정의합니다.
  32. // ~SetFileInfo()
  33. // {
  34. // // 이 코드를 변경하지 마세요. 'Dispose(bool disposing)' 메서드에 정리 코드를 입력합니다.
  35. // Dispose(disposing: false);
  36. // }
  37. public void Dispose()
  38. {
  39. // 이 코드를 변경하지 마세요. 'Dispose(bool disposing)' 메서드에 정리 코드를 입력합니다.
  40. Dispose(disposing: true);
  41. GC.SuppressFinalize(this);
  42. }
  43. }
  44. public class AipFileInfo
  45. {
  46. public int errorCode { get; set; } = 0;
  47. public string errorMessage { get; set; } = string.Empty;
  48. public AipContentLabel Content{ get; set; }
  49. public AipLabel Label { get; set; }
  50. public AipProtection Protection { get; set; }
  51. public Int64 FileSize { get; set; }
  52. public string OutputFileName { get; set; }
  53. //public static implicit operator List<object>(AipFileInfo v)
  54. //{
  55. // throw new NotImplementedException();
  56. //}
  57. }
  58. public enum AipAssignmentMethod
  59. {
  60. /// <summary>Label assignment method is standard</summary>
  61. Standard,
  62. /// <summary>Label assignment method is privileged</summary>
  63. Privileged,
  64. /// <summary>Label assignment method is automatic</summary>
  65. Auto,
  66. }
  67. public enum AipProtectionType
  68. {
  69. /// <summary>Protection was created from a template</summary>
  70. TemplateBased,
  71. /// <summary>Protection was created ad hoc</summary>
  72. Custom,
  73. }
  74. public class AipLabelInfo
  75. {
  76. /// <summary>The unique GUID for the label within the tenant</summary>
  77. public string LabelId { get; set; } = "";
  78. /// <summary>GUID of the tenant that owns the label</summary>
  79. public string TenantId { get; set; } = "";
  80. }
  81. public class AipProtectionDescriptor
  82. {
  83. /// <summary>The protection type</summary>
  84. public AipProtectionType ProtectionType { get; set; }
  85. /// <summary>Collection of users-to-roles mappings</summary>
  86. // public List<Microsoft.InformationProtection.UserRoles> UserRoles { get; set; }
  87. //
  88. // /// <summary>Collection of users-to-rights mappings</summary>
  89. // public List<Microsoft.InformationProtection.UserRights> UserRights { get; set; }
  90. /// <summary>
  91. /// The RMS template id for template protection, license id for adhoc protection, if any
  92. /// </summary>
  93. public string TemplateId { get; set; }
  94. /// <summary>
  95. /// Gets the Label info, if any
  96. /// This property will only be populated in ProtectionDescriptors for preexisting protected content. i.e. It is
  97. /// a field populated by the server at the moment protected content is consumed.
  98. /// </summary>
  99. public AipLabelInfo LabelInformation { get; set; }
  100. /// <summary>
  101. /// Gets the Label id, if any
  102. /// This property will only be populated in ProtectionDescriptors for preexisting protected content. i.e. It is
  103. /// a field populated by the server at the moment protected content is consumed.
  104. /// </summary>
  105. public string LabelId { get; set; }
  106. /// <summary>The owner of protection</summary>
  107. public string Owner { get; set; }
  108. /// <summary>
  109. /// Gets the content id
  110. /// Publishing licenses will have this identifier surrounded by curly braces "{}".
  111. /// Those braces are removed from the value returned here
  112. /// </summary>
  113. public string ContentId { get; set; }
  114. /// <summary>The protection name</summary>
  115. public string Name { get; set; }
  116. /// <summary>The protection description</summary>
  117. public string Description { get; set; }
  118. /// <summary>
  119. /// Whether or not protection allows offline content access (default = true)
  120. /// </summary>
  121. public bool AllowOfflineAccess { get; set; }
  122. /// <summary>Protection referrer address</summary>
  123. public string Referrer { get; set; }
  124. /// <summary>Protection expiration time</summary>
  125. public DateTime? ContentValidUntil { get; set; }
  126. /// <summary>App-specific data that was encrypted</summary>
  127. // public Dictionary<string, string> EncryptedAppData { get; set; }
  128. //
  129. // /// <summary>App-specific data that was signed</summary>
  130. // public Dictionary<string, string> SignedAppData { get; set; }
  131. /// <summary>The double key url</summary>
  132. public string DoubleKeyUrl { get; set; }
  133. }
  134. public class AipProtection
  135. {
  136. public AipProtectionDescriptor ProtectionDescriptor { get; set; }
  137. /// <summary>Email address of content owner</summary>
  138. public string Owner { get; set; }
  139. /// <summary>The user associated with the protection handler</summary>
  140. public string IssuedTo { get; set; }
  141. /// <summary>Whether or not the current user is the content owner</summary>
  142. public bool IsIssuedToOwner { get; set; }
  143. /// <summary>
  144. /// The unique identifier for the document/content
  145. /// Publishing licenses will have this identifier surrounded by curly braces "{}".
  146. /// Those braces are removed from the value returned here
  147. /// </summary>
  148. public string ContentId { get; set; }
  149. /// <summary> Whether or not protection handler uses deprecated crypto algorithms (ECB) for backward compatibility </summary>
  150. public bool UseDeprecatedAlgorithms { get; set; }
  151. /// <summary> Whether or not protection handler grants user 'audited extract' right </summary>
  152. public bool AuditedExtractAllowed { get; set; }
  153. /// <summary> The block size (in bytes) for the cipher mode used by this ProtectionHandler </summary>
  154. public long BlockSize { get; set; }
  155. }
  156. public class AipContentLabel
  157. {
  158. //public AipLabel Label { get; set; }
  159. public DateTime CreationTime { get; set; }
  160. /// <summary>The assignment method of the label.</summary>
  161. public AipAssignmentMethod AssignmentMethod { get; set; }
  162. /// <summary>Returns true if protection was applied by the label or not.</summary>
  163. public bool IsProtectionAppliedFromLabel { get; set; }
  164. }
  165. }