using System;
using System.Collections.Generic;
using Microsoft.InformationProtection;
namespace AipGateway.AIP
{
public enum AipAssignmentMethod
{
/// Label assignment method is standard
Standard,
/// Label assignment method is privileged
Privileged,
/// Label assignment method is automatic
Auto,
}
public enum AipProtectionType
{
/// Protection was created from a template
TemplateBased,
/// Protection was created ad hoc
Custom,
}
public class AipLabelInfo
{
/// The unique GUID for the label within the tenant
public string LabelId { get; set; } = "";
/// GUID of the tenant that owns the label
public string TenantId { get; set; } = "";
}
public class AipProtectionDescriptor
{
/// The protection type
public AipProtectionType ProtectionType { get; set; }
/// Collection of users-to-roles mappings
// public List UserRoles { get; set; }
//
// /// Collection of users-to-rights mappings
// public List UserRights { get; set; }
///
/// The RMS template id for template protection, license id for adhoc protection, if any
///
public string TemplateId { get; set; }
///
/// 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.
///
public AipLabelInfo LabelInformation { get; set; }
///
/// 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.
///
public string LabelId { get; set; }
/// The owner of protection
public string Owner { get; set; }
///
/// Gets the content id
/// Publishing licenses will have this identifier surrounded by curly braces "{}".
/// Those braces are removed from the value returned here
///
public string ContentId { get; set; }
/// The protection name
public string Name { get; set; }
/// The protection description
public string Description { get; set; }
///
/// Whether or not protection allows offline content access (default = true)
///
public bool AllowOfflineAccess { get; set; }
/// Protection referrer address
public string Referrer { get; set; }
/// Protection expiration time
public DateTime? ContentValidUntil { get; set; }
/// App-specific data that was encrypted
// public Dictionary EncryptedAppData { get; set; }
//
// /// App-specific data that was signed
// public Dictionary SignedAppData { get; set; }
/// The double key url
public string DoubleKeyUrl { get; set; }
}
public class AipProtection
{
public AipProtectionDescriptor ProtectionDescriptor { get; set; }
/// Email address of content owner
public string Owner { get; set; }
/// The user associated with the protection handler
public string IssuedTo { get; set; }
/// Whether or not the current user is the content owner
public bool IsIssuedToOwner { get; set; }
///
/// 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
///
public string ContentId { get; set; }
/// Whether or not protection handler uses deprecated crypto algorithms (ECB) for backward compatibility
public bool UseDeprecatedAlgorithms { get; set; }
/// Whether or not protection handler grants user 'audited extract' right
public bool AuditedExtractAllowed { get; set; }
/// The block size (in bytes) for the cipher mode used by this ProtectionHandler
public long BlockSize { get; set; }
}
public class AipContentLabel
{
public AipLabel Label;
public DateTime CreationTime { get; set; }
/// The assignment method of the label.
public AipAssignmentMethod AssignmentMethod { get; set; }
/// Returns true if protection was applied by the label or not.
public bool IsProtectionAppliedFromLabel { get; set; }
}
public class AipFileInfo
{
public AipContentLabel ContentLabel { get; set; }
public AipProtection Protection { get; set; }
public string OutputFileName { get; set; }
}
}