123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- using System;
- namespace AipGateway.AIP
- {
- public class SetFileInfo : IDisposable
- {
- private bool disposedValue;
- public int errorNo { get; set; }
- public string errorMsg { get; set; } = string.Empty;
- public string labelGuid { get; set; } = string.Empty;
- public string templateGuid { get; set; } = string.Empty;
- public string fileOwner { get; set; } = string.Empty;
- public Int64 fileSize { get; set; }
- public string newFileName { get; set; } = string.Empty;
- public string newFileOwner { get; set; } = string.Empty;
- public string newFileLabelGuid { get; set; } = string.Empty;
- public string newFileTemplateGuid { get; set; } = string.Empty;
- public Int64 newFileSize { get; set; }
- protected virtual void Dispose(bool disposing)
- {
- if (!disposedValue)
- {
- if (disposing)
- {
- // TODO: 관리형 상태(관리형 개체)를 삭제합니다.
- }
- // TODO: 비관리형 리소스(비관리형 개체)를 해제하고 종료자를 재정의합니다.
- // TODO: 큰 필드를 null로 설정합니다.
- disposedValue = true;
- }
- }
- // // TODO: 비관리형 리소스를 해제하는 코드가 'Dispose(bool disposing)'에 포함된 경우에만 종료자를 재정의합니다.
- // ~SetFileInfo()
- // {
- // // 이 코드를 변경하지 마세요. 'Dispose(bool disposing)' 메서드에 정리 코드를 입력합니다.
- // Dispose(disposing: false);
- // }
- public void Dispose()
- {
- // 이 코드를 변경하지 마세요. 'Dispose(bool disposing)' 메서드에 정리 코드를 입력합니다.
- Dispose(disposing: true);
- GC.SuppressFinalize(this);
- }
- }
- public class AipFileInfo
- {
- public int errorCode { get; set; } = 0;
- public string errorMessage { get; set; } = string.Empty;
- public AipContentLabel Content{ get; set; }
- public AipLabel Label { get; set; }
- public AipProtection Protection { get; set; }
- public Int64 FileSize { get; set; }
- public string OutputFileName { get; set; }
- //public static implicit operator List<object>(AipFileInfo v)
- //{
- // throw new NotImplementedException();
- //}
- }
- public enum AipAssignmentMethod
- {
- /// <summary>Label assignment method is standard</summary>
- Standard,
- /// <summary>Label assignment method is privileged</summary>
- Privileged,
- /// <summary>Label assignment method is automatic</summary>
- Auto,
- }
- public enum AipProtectionType
- {
- /// <summary>Protection was created from a template</summary>
- TemplateBased,
- /// <summary>Protection was created ad hoc</summary>
- Custom,
- }
- public class AipLabelInfo
- {
- /// <summary>The unique GUID for the label within the tenant</summary>
- public string LabelId { get; set; } = "";
- /// <summary>GUID of the tenant that owns the label</summary>
- public string TenantId { get; set; } = "";
- }
- public class AipProtectionDescriptor
- {
- /// <summary>The protection type</summary>
- public AipProtectionType ProtectionType { get; set; }
- /// <summary>Collection of users-to-roles mappings</summary>
- // public List<Microsoft.InformationProtection.UserRoles> UserRoles { get; set; }
- //
- // /// <summary>Collection of users-to-rights mappings</summary>
- // public List<Microsoft.InformationProtection.UserRights> UserRights { get; set; }
- /// <summary>
- /// The RMS template id for template protection, license id for adhoc protection, if any
- /// </summary>
- public string TemplateId { get; set; }
- /// <summary>
- /// Gets the Label info, if any
- /// This property will only be populated in ProtectionDescriptors for preexisting protected content. i.e. It is
- /// a field populated by the server at the moment protected content is consumed.
- /// </summary>
- public AipLabelInfo LabelInformation { get; set; }
- /// <summary>
- /// Gets the Label id, if any
- /// This property will only be populated in ProtectionDescriptors for preexisting protected content. i.e. It is
- /// a field populated by the server at the moment protected content is consumed.
- /// </summary>
- public string LabelId { get; set; }
- /// <summary>The owner of protection</summary>
- public string Owner { get; set; }
- /// <summary>
- /// Gets the content id
- /// Publishing licenses will have this identifier surrounded by curly braces "{}".
- /// Those braces are removed from the value returned here
- /// </summary>
- public string ContentId { get; set; }
- /// <summary>The protection name</summary>
- public string Name { get; set; }
- /// <summary>The protection description</summary>
- public string Description { get; set; }
- /// <summary>
- /// Whether or not protection allows offline content access (default = true)
- /// </summary>
- public bool AllowOfflineAccess { get; set; }
- /// <summary>Protection referrer address</summary>
- public string Referrer { get; set; }
- /// <summary>Protection expiration time</summary>
- public DateTime? ContentValidUntil { get; set; }
- /// <summary>App-specific data that was encrypted</summary>
- // public Dictionary<string, string> EncryptedAppData { get; set; }
- //
- // /// <summary>App-specific data that was signed</summary>
- // public Dictionary<string, string> SignedAppData { get; set; }
- /// <summary>The double key url</summary>
- public string DoubleKeyUrl { get; set; }
- }
- public class AipProtection
- {
- public AipProtectionDescriptor ProtectionDescriptor { get; set; }
- /// <summary>Email address of content owner</summary>
- public string Owner { get; set; }
- /// <summary>The user associated with the protection handler</summary>
- public string IssuedTo { get; set; }
- /// <summary>Whether or not the current user is the content owner</summary>
- public bool IsIssuedToOwner { get; set; }
- /// <summary>
- /// The unique identifier for the document/content
- /// Publishing licenses will have this identifier surrounded by curly braces "{}".
- /// Those braces are removed from the value returned here
- /// </summary>
- public string ContentId { get; set; }
- /// <summary> Whether or not protection handler uses deprecated crypto algorithms (ECB) for backward compatibility </summary>
- public bool UseDeprecatedAlgorithms { get; set; }
- /// <summary> Whether or not protection handler grants user 'audited extract' right </summary>
- public bool AuditedExtractAllowed { get; set; }
- /// <summary> The block size (in bytes) for the cipher mode used by this ProtectionHandler </summary>
- public long BlockSize { get; set; }
- }
- public class AipContentLabel
- {
- //public AipLabel Label { get; set; }
- public DateTime CreationTime { get; set; }
- /// <summary>The assignment method of the label.</summary>
- public AipAssignmentMethod AssignmentMethod { get; set; }
- /// <summary>Returns true if protection was applied by the label or not.</summary>
- public bool IsProtectionAppliedFromLabel { get; set; }
- }
- }
|