Success or Failure Identity Response Message
Success or Failure Key Pair Response Message
Add a preexisting KeyPair to a provided identity. This does NOT save the new identity anywhere.
obj containing identity to use
KeyPair object containing keys to add
don't fail if provided KeyPair is already present in DID
Success or Failure Message Response including new identity object
Save an identity to psqr configuration directory for use.
obj containing identity to add
Success or Failure Message Response
Create and add a new KeyPair to a provided identity. If keyName isn't specified, a name will be parsed from the kid. This function will fallback to using 'publish' as a key name. This does NOT save the new identity anywhere.
obj containing identity to use
did with trailing key name
name of key to be added to DID
Success or Failure Message Response including new identity object
Create a completely new Identity. If key names aren't specified, this will attempt to get the key name from the kid and fall back on the name 'publish'.
did with trailing key name
public info obj to be included in DID
list of names of keys to be included
Success or Failure Message Response including full identity
Generate the infoHash of an object.
obj to get hash of
bencoded infoHash string
Create an arbitrary amount of key pairs for a DID. NOTE: This will not add the public keys to the appropriate section of the DID.
string identifying a DID
array of names of keys to create
array of key pairs or false on error
Get the current default id strings from the ENV
Success or Failure Message Response including bdid, kname, and kid
If DID is already present locally, get and return it. If not, get DID from the url in the did parameter string and save it locally. Return the full DID.
string identifying a DID
Success or Failure Message Response including full DID
Get the full identity that is stored locally, including all associated keys present. If no kid is specified, the default identity will be retrieved and returned.
string identifying a DID
Success or Failure Message Response including identity object
Get locally stored identity. If no kid is specified, the default identity will be retrieved and returned. This function will exclude trailing #keyName for no keys.
did with trailing key name
Success or Failure Message Response including identity object
Retrieve a pair of keys stored locally. Keys are returned in JWK format.
did with trailing key name
Success or Failure Message Response including pair of keys requested as JWKs
Remove any key names and return the bare DID string.
DID with trailing key name
bare DID or false on error
Determines what kind of DID a DID string refers to.
string identifying a DID
identified type as string
Assemble http url where a DID can be found based on provided did parameter string.
string identifying a DID
url where DID is located or false on error
Extract key name from KID.
DID with trailing key name
key name or false on error
Retrieve DID from url and save it locally.
string identifying a DID
Success or Failure Message Response including a full DID
Validate an Identity and set it as default in ENV
did with trailing key name
Success or Failure Message Response to set default
Validate an Identity.
obj containing identity to use
Success or Failure Message Response of identity validation including valid identity object
Verify if the specified DID has an admin key associated with it. Return failure if no identity.json file is found or if no admin privileges are returned.
did string
identity object or error message
Success or Failure DID Message Response