123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- using System;
- using System.Collections.Generic;
- using Microsoft.InformationProtection;
- namespace AipGateway.AIP
- {
- 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;
- 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; }
- }
- public class AipFileInfo
- {
- public AipContentLabel ContentLabel { get; set; }
- public AipProtection Protection { get; set; }
- public string OutputFileName { get; set; }
- }
- }
|