JSLib Reference Manual / Exports / SB384

Class: SB384#

Hierarchy#

Table of contents#

Constructors#

Properties#

Accessors#

Methods#

Constructors#

constructor#

new SB384(key?)

Basic (core) capability object in SB.

Note that all the getters below will throw an exception if the corresponding information is not ready.

Like most SB classes, SB384 follows the “ready template” design pattern: the object is immediately available upon creation, but isn’t “ready” until it says it’s ready. See Channel Class_ example below.

Parameters#

Name

Type

Description

key?

JsonWebKey

a jwk with which to create identity; if not provided, it will ‘mint’ (generate) them randomly, in other words it will default to creating a new identity (“384”).

Properties#

#SB384ReadyFlag#

Private #SB384ReadyFlag: boolean = false


#exportable_privateKey#

Private #exportable_privateKey: null | JsonWebKey = null


#exportable_pubKey#

Private #exportable_pubKey: null | JsonWebKey = null


#keyPair#

Private #keyPair: null | CryptoKeyPair = null


#ownerChannelId#

Private #ownerChannelId: null | string = null


#privateKey#

Private #privateKey: null | CryptoKey = null


ready#

ready: Promise<SB384>


sb384Ready#

sb384Ready: Promise<SB384>

Accessors#

_id#

get _id(): string

Returns#

string


exportable_privateKey#

get exportable_privateKey(): null | JsonWebKey

Returns#

null | JsonWebKey


exportable_pubKey#

get exportable_pubKey(): null | JsonWebKey

Returns#

null | JsonWebKey


keyPair#

get keyPair(): null | CryptoKeyPair

Returns#

null | CryptoKeyPair


ownerChannelId#

get ownerChannelId(): null | string

Returns#

null | string


privateKey#

get privateKey(): null | CryptoKey

Returns#

null | CryptoKey


readyFlag#

get readyFlag(): boolean

Returns#

boolean

Methods#

#generateRoomHash#

Private #generateRoomHash(channelBytes): Promise<string>

Parameters#

Name

Type

channelBytes

ArrayBuffer

Returns#

Promise<string>


#generateRoomId#

Private #generateRoomId(x, y): Promise<string>

Parameters#

Name

Type

x

string

y

string

Returns#

Promise<string>