Skip to main content

Create trust anchor

Create a trust anchor to subscribe to a published trust anchor.

Related guide: Trust management

Function

createTrustAnchor(
request: CreateTrustAnchorRequest
): Promise<TrustAnchor["id"]>;

Parameters

export type CreateTrustAnchorRequest = {
name: string;
type: string;
} & (
| {
isPublisher: true;
publisherReference?: never;
}
| {
isPublisher?: false;
publisherReference: string;
}
);
  • isPublisher - If true the created trust anchor will be published. If subscribing to an existing trust anchor, omit or set to false. For mobile devices, this should be set to false. The remote anchor must be specified via publisherReference.

  • name - Must be unique.

  • type - Specify the type of trust management anchor to publish or subscribe to. Possible values from the configuration.

  • publisherReference - URL of the remote trust anchor to subscribe to. It must be provided if and only if isPublisher = false.

Return value

The id of the created trust anchor is returned.