securedrm

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package securedrm is the client of SecureDRM, Ulka Networks' hosted key service: it keeps each video's key and hands it only to players carrying a token this server signed. Without it (KEY_SERVICE=local) keys stay in the database.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoKey      = errors.New("key service has no key for this video")
	ErrKeyRefused = errors.New("key service refused the API key")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	URL         string // e.g. https://b.securedrm.link
	APIKey      string
	TokenKid    string
	TokenSecret []byte
	Client      *http.Client
}

Client is a core.KeyStore kept by SecureDRM.

func (*Client) Create

func (k *Client) Create(ctx context.Context, contentID string) (key, iv []byte, err error)

Create returns the video's key, made on first call; asking again returns the same one.

func (*Client) Delete

func (k *Client) Delete(ctx context.Context, contentID string) error

Delete forgets a video's key; one already gone is not an error.

func (*Client) Get

func (k *Client) Get(ctx context.Context, contentID string) (key, iv []byte, err error)

func (*Client) Ping

func (k *Client) Ping(ctx context.Context) error

Ping checks the service answers and accepts the API key, at start.

func (*Client) PlayerURL

func (k *Client) PlayerURL(contentID string, exp time.Time) string

PlayerURL is where a player fetches the video's key: a token for this video until exp, signed HS256.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL