github.com/readium/readium-lcp-server@v0.0.0-20240101192032-6e95190e99f1/frontend/manage/app/components/partialLicense.ts (about)

     1  import { User } from './user';
     2  
     3  export const BASIC_PROFILE = 'http://readium.org/lcp/basic-profile';
     4  export const V1_PROFILE = 'http://readium.org/lcp/profile-1.0';
     5  
     6  export const USERKEY_ALGO = 'http://www.w3.org/2001/04/xmlenc#sha256';
     7  export const PROVIDER = 'http://edrlab.org';
     8  
     9  export class Key {
    10      algorithm: string;
    11  }
    12  
    13  export class ContentKey extends Key {
    14      encrypted_value: any[] | undefined;
    15  }
    16  
    17  export class UserKey extends Key {
    18      text_hint:   string;
    19      key_check:   any[] | undefined;
    20      value:       any[] | undefined;
    21      clear_value: string | undefined;
    22  }
    23  
    24  export class  Encryption {
    25      profile:     string;
    26      content_key: ContentKey | undefined;
    27      user_key:    UserKey    | undefined;
    28  }
    29  
    30  export class Link {
    31      rel:       string;
    32      href:      string;
    33      type:      string  | undefined;
    34      title:     string  | undefined;
    35      profile:   string  | undefined;
    36      templated: boolean | undefined;
    37      size:      number  | undefined;
    38      checksum:  string  | undefined;
    39  };
    40  
    41  export class UserRights {
    42      print: number | undefined;
    43      copy:  number | undefined;
    44      start: Date |undefined;
    45      end:   Date |undefined;
    46  }
    47  
    48  export class  UserInfo  {
    49      id:        string;
    50      email:     string;
    51      name:      string;
    52      encrypted: string[] | undefined;
    53  }
    54  
    55  
    56  export class PartialLicense {
    57      provider:   string;  // 'http://edrlab.org'
    58      user:       UserInfo;  // get it from  user.user_id, user_email, ...
    59      encryption: Encryption; 
    60      rights:     UserRights | undefined;
    61  }
    62  
    63  export class PartialLicenseJSON extends PartialLicense {
    64      // function to encode / decode JSON string
    65      
    66  }