Skip to main content

KeypairService

danger

This Service has been deprecated in favor of the new keys service which stores keys in the pod's /keys container instead of the filesystem. Please consider migrating by calling keys.migration.migrateKeysToDb. Before migration, the new service can not operate and ED25519 keys are not supported by this service. After migration requests will be redirected to the new service.

Features

  • Key pairs management (create, get, delete)
  • Get remote actor public key
  • Attach public key to new actor
  • Automatically generate key pairs and attach the public key to new actors

Dependencies

  • None

Settings

PropertyTypeDefaultDescription
actorsKeyPairsDirStringrequiredPath to where the actor's key pair will be stored.

Actions

The following service actions are available.

attachPublicKey

Attach the public key to an actor data. Use the https://w3id.org/security#publicKey predicate.

Parameters
PropertyTypeDefaultDescription
actorUriStringrequiredURI of the given actor

delete

Delete the private/public key pair of a given actor.

Parameters
PropertyTypeDefaultDescription
actorUriStringrequiredURI of the actor

generate

Generate the private/public key pair for a given actor.

Parameters
PropertyTypeDefaultDescription
actorUriStringrequiredURI of the actor for which will generate the key pairs
Return

String - The generated public key.

get

Get the private/public keys of a given actor

Parameters
PropertyTypeDefaultDescription
actorUriStringrequiredURI of the actor
Return

Object with two keys: publicKey and privateKey.

getPaths

Get the path of the private/public keys of a given actor

Parameters
PropertyTypeDefaultDescription
actorUriStringrequiredURI of the actor
Return

Object with two keys: publicKeyPath and privateKeyPath.

getRemotePublicKey

Get the public key of a remote actor. Keep it in a local cache.

Parameters
PropertyTypeDefaultDescription
actorUriStringrequiredURI of the remote actor
Return

String - The public key of the remote actor.