atKey Reference
AtKey
Please note that any reference to the word "AtKey" in this document is not associated with cryptographic keys. The atKey is the "key" of the key-value pair that makes up an atRecord.
This article explains how to create an atKey in the atClient SDK.
If you are unfamiliar with atKeys please read this first.
The at_commons package contains common elements used in a number of Atsign's Flutter and Dart packages. This package needs to be included in the application in order to create atKeys.
Installation
First add the package to your project:
Or add the package to your pubspec.yaml
manually:
Usage
See below for how to create the various types of atKeys.
Public atKey
To create a public atKey, first use the AtKey.public
builder to configure it, then call .build
to create it.
The build
method on PublicKeyBuilder
takes no parameters.
Example
public:phone.wavi@alice
Self atKey
To create a self atkeyD, first use the AtKey.self
builder to configure it, then call .build
to create it.
The build
method on SelfKeyBuilder
takes no parameters.
Example
phone.wavi@alice
Private atKey
To create a private atKey, first use the AtKey.private
builder to configure it, then call .build
to create it.
The difference between a private and a self atkey is that the private atKey is hidden by default when using the atProtocol scan verb.
The build
method on PrivateKeyBuilder
takes no parameters.
Example
privatekey:phone.wavi@alice
Shared atKey
To create a shared atKey, first use the AtKey.shared
builder to configure it, then call .build
to create it.
The build
method on SharedKeyBuilder
takes no parameters.
Example
@bob:phone.wavi@alice
Caching shared atKeys
To cache a shared atKey, you can do a cascade call on SharedKeyBuilder.cache
.
API Docs
You can find the API reference for the entire package available on pub.
The AtKey
class API reference is available here.
Last updated