Class DRM

Hierarchy

  • DRM

Constructors

Properties

license?: License

The loaded license

License storage implementation

License validator implementation

Accessors

  • get hasLicense(): boolean
  • Check if the license is available

    Returns boolean

Methods

  • Try loading license using the storage implementation

    Throws

    MisingLicenseError If license can not be loaded

    Parameters

    • Rest ...args: any[]

    Returns Promise<DRM>

  • Sets a signed license to be used

    Parameters

    • license: string | License

      The license object or string

    Returns DRM

  • Validate either loaded or provided license

    Throws

    NoLicenseError If no license to store

    Throws

    PersistingLicenseError If license unable to be persisted

    Parameters

    • Optional license: string | License

    Returns Promise<DRM>

  • Validate either loaded or provided license

    Throws

    NoLicenseError If no license to validate

    Parameters

    • Optional license: string | License

      Optional license to validate

    Returns Promise<boolean>

  • Create DRM instance with offline license validation

    Parameters

    • issuers: Map<string, PublicKey>

      Issuers mapping ID => PublicKey

    • Optional storages: ILicenseStorage[]

      Storages to use, defaults: EnvStorage, FileStorage

    • Optional license: License

      License to set, if any

    Returns DRM

Generated using TypeDoc