API Docs for: 1.3.12
Show:

EcIdentityManager Class

Manages identities and contacts, provides hooks to respond to identity and contact events, and builds signatures and signature sheets for authorizing movement of data. Also provides helper functions for identity management and reads the users contacts on application start with a static constructor that pulls them out of any temporary storage

Methods

addContact

(
  • contact
)
static

Adds a contact to the identity manager. Checks for duplicates. Triggers events.

Parameters:

addContactQuietly

(
  • contact
)
static

Adds a contact to the identity manager. Checks for duplicates. Does not trigger events.

Parameters:

addIdentity

(
  • identity
)
static

Adds an identity to the identity manager. Checks for duplicates. Triggers events.

Parameters:

addIdentityQuietly

(
  • identity
)
static

Adds an identity to the identity manager. Checks for duplicates. Does not trigger events.

Parameters:

clear

()

Wipes login data and logs you out.

clearContacts

() static

Clears contacts from the local storage

clearIdentities

() static

Clears identities from the local storage

commit

(
  • success
  • failure
)

Commits credentials in EcIdentityManager to remote server.

Parameters:

  • success Callback1
  • failure Callback1

contactChanged

(
  • contact
)
static

Trigger for the onContactChanged hook

Parameters:

createSignature

(
  • duration
  • server
  • ppk
)
Ebac Signature static

Create a signature for a specific identity, authorizing movement of data outside of our control.

Parameters:

  • duration Long

    Length of time in milliseconds to authorize control.

  • server String

    Server that we are authorizing.

  • ppk EcPpk

    Key of the identity to create a signature for

Returns:

Ebac Signature:

Signature created

createSignatureAsync

(
  • duration
  • server
  • ppk
  • success
)
static

Asynchronously create a signature for a specific identity

Parameters:

  • duration Long

    Length of time in milliseconds to authorize control.

  • server String

    Server that we are authorizing.

  • ppk EcPpk

    Key of the identity to create a signature for

  • success Object

    Callback triggered once the signature sheet has been created, returns the signature

fetch

(
  • success
  • failure
)

Fetch credentials from server, invoking events based on login success or failure.

Automatically populates EcIdentityManager.

Does not require startLogin().

Parameters:

  • success Callback1
  • failure Callback1
  • getContact

    (
    • pk
    )
    EcPpk static

    Get Contact from PK (if we have it)

    Parameters:

    • pk EcPk

      PK to use to look up PPK

    Returns:

    EcPpk:

    PPK or null.

    getIdentity

    (
    • pk
    )
    EcIdentity static

    Get Identity from PK (if we have it)

    Parameters:

    • pk EcPk

      PK to use to look up PPK

    Returns:

    EcIdentity:

    identity or null.

    getPpk

    (
    • fromPem
    )
    EcPpk static

    Get PPK from PK (if we have it)

    Parameters:

    • fromPem EcPk

      PK to use to look up PPK

    Returns:

    EcPpk:

    PPK or null.

    identityChanged

    (
    • identity
    )
    static

    Trigger for the onIdentityChanged hook

    Parameters:

    isGlobal

    () Boolean

    Returns true if the identity manager is global. Returns false if the identity manager is local to the server.

    Returns:

    Boolean:

    true if the identity manager is global.

    readContacts

    () static

    Reads contact data from localstorage.

    readIdentities

    () static

    Reads contact data from localstorage.

    saveContacts

    () static

    Writes contact data to localstorage.

    saveIdentities

    () static

    Writes contact data to localstorage.

    setDefaultIdentityManagementServer

    (
    • server
    )

    Configure compatible remote identity management server.

    Parameters:

    • server String

      Name of the remote identity management server.

    sign

    (
    • d
    )
    static

    Sign a piece of data with all available keys that own that data.

    Parameters:

    signatureSheet

    (
    • duration
    • server
    )
    String static

    Create a signature sheet for all identities, authorizing movement of data outside of our control.

    Parameters:

    • duration Long

      Length of time in milliseconds to authorize control.

    • server String

      Server that we are authorizing.

    Returns:

    String:

    JSON Array containing signatures.

    signatureSheetAsync

    (
    • duration
    • server
    • success
    )
    static

    Asynchronous version of creating a signature sheet for all identities

    Parameters:

    • duration Long

      Length of time in milliseconds to authorize control.

    • server String

      Server that we are authorizing.

    • success Callback

      Callback triggered once the signature sheet has been created, returns the signature sheet

    signatureSheetFor

    (
    • identityPksinPem
    • duration
    • server
    )
    String static

    Create a signature sheet, authorizing movement of data outside of our control.

    Parameters:

    • identityPksinPem String

      Which identities to create signatures for.

    • duration Long

      Length of time in milliseconds to authorize control.

    • server String

      Server that we are authorizing.

    Returns:

    String:

    JSON Array containing signatures.

    signatureSheetForAsync

    (
    • identityPksinPem
    • duration
    • server
    • success
    )
    static

    Asynchronous version of creating a signature sheet for a list of identities

    Parameters:

    • identityPksinPem String

      Which identities to create signatures for.

    • duration Long

      Length of time in milliseconds to authorize control.

    • server String

      Server that we are authorizing.

    • success Callback1

      Callback triggered once the signature sheet has been created, returns the signature sheet

    Properties

    contacts

    EcContact[] static

    Contacts (Keys that we do not own)

    ids

    EcIdentity[] static

    The current user's owned identities (keys+displayName)

    onContactChanged

    Callback1 static

    Contacts change hook.

    onIdentityChanged

    Callback1 static

    Identity change hook.