Home Reference Source Test
public class | source

UnsecuredFileKeyStore

Static Method Summary

Static Public Methods
public static

Get the ID of the most recently active member.

public static

Keep track of the ID of the most recently active member.

public static

setDirRoot(dirRoot: *)

Method Summary

Public Methods
public

async getById(memberId: string, keyId: string): Object

Look up a key by memberId and keyId.

public

async getByLevel(memberId: string, level: string): Object

Look up a key by memberId and level.

public

async listKeys(memberId: string): Object

Return list of member's keys.

public

async put(memberId: string, keyPair: Object): Object

Store a key pair.

Private Methods
private

async _loadMember(memberId: string): Object

Load a member's keys.

private

async _saveMember(memberId: string, member: Object)

Save a member's keys.

Static Public Methods

public static getActiveMemberId(): string source

Get the ID of the most recently active member.

Return:

string

ID of member

public static setActiveMemberId(memberId: string) source

Keep track of the ID of the most recently active member.

Params:

NameTypeAttributeDescription
memberId string

ID of member

public static setDirRoot(dirRoot: *) source

Params:

NameTypeAttributeDescription
dirRoot *

Public Methods

public async getById(memberId: string, keyId: string): Object source

Look up a key by memberId and keyId.

Params:

NameTypeAttributeDescription
memberId string

ID of member

keyId string

key ID

Return:

Object

key pair

public async getByLevel(memberId: string, level: string): Object source

Look up a key by memberId and level.

Params:

NameTypeAttributeDescription
memberId string

ID of member

level string

'LOW', 'STANDARD', or 'PRIVILEGED'

Return:

Object

key pair

public async listKeys(memberId: string): Object source

Return list of member's keys.

Params:

NameTypeAttributeDescription
memberId string

ID of member

Return:

Object

list of keys

public async put(memberId: string, keyPair: Object): Object source

Store a key pair.

Params:

NameTypeAttributeDescription
memberId string

ID of member

keyPair Object

key pair

Return:

Object

stored key pair

Private Methods

private async _loadMember(memberId: string): Object source

Load a member's keys.

Params:

NameTypeAttributeDescription
memberId string

ID of member

Return:

Object

object dict level : key {'LOW': {...}, 'STANDARD': {...}, ...}

private async _saveMember(memberId: string, member: Object) source

Save a member's keys.

Params:

NameTypeAttributeDescription
memberId string

member ID

member Object

obj dict of keys { 'LOW': {...}, 'STANDARD': {...}, ... }