at_client_io library
at_client for a native Dart program: everything in at_client.dart, plus
the pieces that need dart:io — keys in a file, connections over TLS on
TCP, and the atDirectory asked over TLS.
at_client.dart names none of these, so a program that imports it alone
compiles for any platform and supplies its own.
Classes
- AdvertisedKeyVerifier
- Checks that a fetched advertisement really came from the atSign that claims it, before anything is encapsulated to it.
- AndPredicate
- Conjunction. All children must hold. Flattens on construction via Predicate.and so chains don't build a left-leaning tree.
- ApkamSignedAdvertisedKeys
-
Verifies an advertisement's APKAM signature against the
_apskpublic key that the signing enrollment published underowner's atSign. - AppMetadata
- ApskRecord
-
One enrollment's
_apskrecord as a walk or a voucher reads it: the keys it lists and the links stored on it. - ApskSigningKey
-
One signing key read back out of an
_apskadvertisement. -
AtBuffer<
T> - Class holder for message of different data types(int, String etc.,)
- AtBytes
- Wrapper class for handling base64 encoded byte data
- AtChainedException
- AtClient
- Interface for a client application that can communicate with a secondary server.
- AtClientImpl
- Implementation of the AtClient interface.
- AtClientManager
- Holds the current AtClient and tells the switch listeners when it changes.
- AtClientParticulars
-
What a client tells its atServer about the app it runs in, set on
AtClientPreference.atClientParticulars. - AtClientPreference
-
Class to hold attributes for client preferences.
Set the preferences for your application and pass it to
Atsign.openorbuildAtClient. - AtClientStorage
- The local storage one AtClient holds: its keystore and its sync queue.
- AtClientStorageBase
- The claim rules every AtClientStorage shares; a backend supplies location, openBackend, closeBackend and clearData.
- AtClientUtil
-
AtCollection<
T> - AtCommandExecutor
-
The narrow view of a connection that an
AtAuthenticatoris given: enough to run a challenge-response, and nothing else. - AtConnection
- A client's connection state: the current value, the transitions, and a way to try again now.
- AtConnectionState
- What a client's connection to its atServer is, and why.
- AtConstants
- AtExceptionManager
- AtExceptionManager is responsible for creating instances of the appropriate exception classes for a given exception scenario.
- AtExceptionStack
- Class to maintain stack of exceptions to form a chained exception.
- AtExceptionUtils
- Utility class that returns instance of exception for the given error code.
- AtKey
- AtKeys
- The in-memory model of an atsign's cryptographic keys.
- AtKeysIo
- Base type for reading AtKeys. Implemented by classes that read AtKeys from different sources.
- AtKeyValidator
- Validates String representation of a AtKey For example String representation of a public key PublicKey will be public:phone.wavi@bob
- AtKeyValidators
- Returns an instance of AtKeyValidator
- AtNetworkTimeouts
- Process-wide network timeout policy for the Atsign SDK.
- AtNotification
- AtReachabilityResult
-
What
AtClient.ensureReachableanswered, and why. - AtRootDomain
- AtRpc
- A simple rpc request-response abstraction which uses Atsign Protocol notifications under the hood.
- AtRpcCallbacks
- The callbacks which the creator of the AtRpc object needs to provide
- AtRpcClient
- AtRpcReq
- Simple data structure whose JSON is transmitted as the payload of the notification which is sent from the requester to the responder
- AtRpcResp
- Simple data structure whose JSON is transmitted as the payload of the notification which is sent by the responder back to the requester
- AtServerEvent
- Events which are generated by an atServer. Initial example is the AtSignPKChangedEvent but we want to allow for others in future.
- AtServiceFactory
- Abstraction over the construction of the core services managed by AtClientManager.
- AtSignChangeListener
- AtSignLogger
- Class for AtSignLogger Implementation
- AtSignPKChangedEvent
- This event is specific to when the 'public:publickey@alice' key changes.
- AtSignServerCheck
- What checkAtSignServer found: the state, and for the two unreachable states the cause the lookup failed with.
- AtTelemetryEvent
- Concrete AtTelemetryItem subclass for Events - e.g. SyncStarted, NetworkUnavailable, MonitorUnavailable
- AtTelemetryItem
- Generic telemetry datum
- AtTelemetrySample
- Concrete AtTelemetryItem subclass for Samples - e.g. KeyStoreSize, DataReceived, DataTransmitted
- AtTelemetryService
- Simple software telemetry service. See https://en.wikipedia.org/wiki/Telemetry#Software
- AtValue
- AwaitsStartUpAsk
- Implemented by an NskeyKeyRing whose client's start-up asks the atSign's other enrollments for the own privates it lacks.
- BatchRequest
- BatchResponse
- ByteBuffer
- CacheableSecondaryAddressFinder
- Finds an atSign's atServer by asking the atDirectory at a root domain and port, and keeps each answer for an hour, or the duration it is given.
- CAncestor
- A single link in a sub-item's parent chain.
- CEvent
- Base class for everything emitted on an AtCollection's event streams.
- ChainResult
- What a walk found.
-
CItem<
T> -
A single typed record in an AtCollection. Wraps an application's
domain object of type
Ttogether with Atsign Protocol object metadata: - CItemAvailable
-
Fires when a scheduled item's
availableAttime passes — i.e. an item written withavailableAtin the future has just become visible on the wire. Carries the item's owner + id so the listener can refetch it via AtCollection.getOrNull. - CItemDeleted
- CItemExpiringSoon
-
Fires leadTime before an item's
expiresAt. Useful for reminder / alarm UIs that need to nudge the user before a record disappears (the atServer expires items hard atexpiresAt, so once that moment arrives the record is already gone). - CItemUpdated
- CkManager
- Keeps a current content key in place for each destination a client writes to.
- CkRotationContext
- What a CkRotationPolicy is told about the content key it is deciding on.
- CmpPredicate
- Leaf comparison predicate produced by PathField operators. Carries the field, op, and value publicly so a future indexed executor can pattern-match.
- ConflictInfo
- ContentKey
- A symmetric content key (CK) and its id.
- ContentKeyCache
-
Cache of decapsulated content keys, keyed by
(owner, namespace, ckKid). - ContentKeyEviction
- Drops a cached content key when this client observes its conveyance record being deleted.
- CReadReceipt
-
Fires when a remote atSign posts a receipt for an item we can
observe. owner + id identify the PARENT item being read (the
thing the receipt is about — not the receipt sub-item itself), so
they match the
owner+idof the corresponding CItem. from is the reader; readAt is the moment the notification was received (not the moment the reader wrote it). - CryptoConfig
- Selects and configures the crypto providers for an AtClient.
- CryptoContext
- What a CryptoProvider is handed per operation.
- CryptoProvider
-
The contract every encryption scheme implements. The SDK routes each
AtKey to a provider by its
appMetadata.providerId. - CryptoRuntime
-
Routes encryption/decryption to the CryptoProvider named by an AtKey's
appMetadata.providerId. - CSubItemDeleted
- CSubItemUpdated
- DataDeleted
- A keystore record was removed.
- DataEvent
-
Event emitted on AtClient.dataEvents whenever a keystore
mutation passes through
LocalSecondary's chokepoint methods (_update/_delete). Subscribers see every change driven by this client — local app writes AND sync-applied remote changes — in a single uniform stream. - DataUpdated
-
A keystore record was created or updated. Carries the metadata
constructed from the
UpdateVerbBuilderthat drove the write so listeners (e.g. an event-driven expiry timer) can readexpiresAtwithout re-fetching the record. - DefaultAtServiceFactory
- DeleteRequestOptions
-
Parameters that application code can optionally provide when calling
AtClient.delete - Enrollment
- Class represents the enrollment details
- EnrollmentConstants
- EnrollmentListRequestParam
- Class to store request parameters while fetching a list of enrollments
- Enrollments
-
This atSign's enrollments, managed through a client that authenticates as
one holding
__manage: the roster, the decisions on it, and the passcodes a new request has to quote. - EnrollmentService
- EnrollmentService contains methods to fetch the enrollment details and methods to perform operations on the enrollments.
- EnrollParams
- EnvelopeKeySelected
- The key verifySignedEnvelope would check the envelope's signature against.
- EnvelopeKeySelection
- What selectEnvelopeKey found.
- EnvelopeRefused
- The envelope does not verify against signer, and why.
- EnvelopeSignature
-
One entry of a SignedEnvelope's
signaturesarray: a protected header and the signature over it. - EnvelopeVerification
- What verifySignedEnvelope found.
- EnvelopeVerified
- The envelope names signer's enrollment, names signer's Atsign or none, and its signature verifies under a key signer lists.
- FileAtKeysIo
-
File-backed
.atKeysstorage. - FixedSecondaryAddressFinder
- Resolves every atSign to one fixed address, without touching the network.
- GetRequestOptions
-
Parameters that application code can optionally provide when calling
AtClient.getorAtClient.getMeta - HandlesSelectively
- Implemented by a CryptoProvider that can only handle some keys.
- InfoFeature
-
The names an atServer lists capabilities under in its
infofeatures. - InfoFeatures
-
The features one atServer listed in one
inforeply, read the same way by a client and by an atServer reading a peer. - InfoFeatureStatus
-
The statuses an atServer gives a feature in its
infofeatures, spelt exactly as they travel. - InMemoryAtKeysIo
- Stores AtKeys in process memory, for tests.
- InMemoryNskeyKeyRing
- An in-memory NskeyKeyRing seeded directly with keypairs.
-
IterableKeyStream<
T> - Class to expose a stream of Iterable<AtKey> based on the provided query parameters
- KeyFormatValidation
- Validates if the Key adheres to a format represented by a regex
- KeyInfo
- KeyLengthValidation
- Validates key length of a key
- KeyOwnershipValidation
- Validates if the ownership is right for a given key type
- Validates if key is rightly shared
-
KeyStream<
T> - Class to expose a stream of AtKey based on the provided query parameters
- LinkVoucher
- What a client vouches for another key with: the signing root's private key, or one of its own keys that already has a link.
-
ListKeyStream<
T> - Class to expose a stream of List<AtKey> based on the provided query parameters
- LocalKey
- Represents a local key Local key are confined to the client(device)/server it is created. The key does not sync between the local-secondary and the cloud-secondary.
- LooksUpLevelsTogether
- Implemented by an NskeyKeyRing that can ask about several of an owner's namespaces at once, as a share asks about every level of its key's name.
-
MapKeyStream<
K, V> - Class to expose a stream of Map<AtKey> based on the provided query parameters
- Metadata
- NamespacePermission
-
Model class representing a namespace permission.
The string representation of the permission is
namespace: {ns1: rw, ns2: r}where read isrand write iswandns1/ns2are the namespaces. - NotificationConfig
- The configurations for the Notification listeners
- NotificationParams
- NotificationParams represents a notification input params.
- NotificationReplay
- Where a monitor's notification replay starts when it connects.
- NotificationResult
- NotificationResult encapsulates the notification response
- NotificationService
- NotPredicate
- Negation. Double-negation collapses via Predicate.not.
- NskeyAdvertisement
-
The encapsulation key(s) an atSign advertises for a namespace at
public:__nskey.<ns>@<owner>. - NskeyKeyRing
-
Where the
at/nskeyprovider gets namespace key material. - NskeyPrivateFiling
- Moves an arriving nskey private out of the secret-sharing transit buffer and into AtKeys, where key material that must survive a restart belongs.
- NskeyProvider
- Layer 2 of the nskey data path: conveys a symmetric content key.
- NskeyRecipientKind
- Which key class a CK was sealed to.
- NskeyResolver
- Finds which level of a nested namespace holds the nskey to seal to.
- NskeyRotation
- Rotates a namespace's nskey keypair, and composes that with revoking an enrollment.
- NskeyRotationContext
- What an NskeyRotationPolicy is told about the namespace key it is deciding on.
- OpFailure
- OpNotAttempted
- A key-level op that was not attempted because the item's own copy could not be written.
- OpResult
- OpSuccess
- OrPredicate
- Disjunction. At least one child must hold. Flattens via Predicate.or.
- Passcode
- A passcode the atServer issued or accepted, and when it stops working; expiry is null when the atServer's own default decides that.
-
PathField<
V> - A typed, introspectable accessor for one field on a CItem<T>. Pair with Query.wherePath / PathField.eq etc. to build a Predicate the library can both evaluate and inspect.
- PendingEnrollment
- An enrollment this device has submitted and the atSign's manager has not yet decided.
- PqPosture
-
How far into the post-quantum rollout a client runs — every rollout axis set
as one value, applied at construction through
AtClientPreference.posture. - PqSigningChain
-
The links that vouch for each key an enrollment's
_apsklists, and the walk from a key up to the atSign's signing root. - PqSigningRoot
-
The atSign's user-owned root of trust — an ML-DSA-65 signer published at
public:pq_signing_root@<atSign>that anchors the chain vouching for enrollment signing keys. - Predicate
-
Root of the typed-predicate AST. Mint with the operator methods on
PathField (e.g.
field.eq(value)); compose with and / or / not. Pass to Query.wherePath to apply. - PreparesWrites
- Implemented by a CryptoProvider that needs to do work — including writing records of its own — before the write pipeline starts.
- PrivateKey
- Obsolete, was never used
- PublicKey
- Represents a public key.
- PublicKeyHash
- Represents hash of an atsign's public encryption key and the hashing algorithm used
- PublishedApsk
-
An
_apskvalue as atSign's enrollment enrollmentId published it atpublic:_apsk.<enrollmentId>.a.__e@<atSign>, and whose it is. - PublishedNskeyKeyRing
-
An NskeyKeyRing that publishes the owner's nskey and discovers other
atSigns' by
plookup. - PutRequestOptions
-
Parameters that application code can optionally provide when calling
AtClient.put,AtClient.putText,AtClient.putBinaryorAtClient.putMeta -
Query<
T> - A composable, value-typed query over an AtCollection<T>. Build up a query with where / orderBy / thenBy / limit / skip, then terminate with get (one-shot) or watch (live reactive).
- ReceivedScheme
- How a value another atSign shared with this client was protected.
- Regexes
- RegexesNonMandatoryNamespace
- RegexesWithMandatoryNamespace
- RegexUtil
- ReportsReadiness
- Implemented by a CryptoProvider whose ability to encrypt for a destination depends on something that destination must have published.
- RequestOptions
-
Parameters that application code can optionally provide when calling
AtClient.get,AtClient.getMeta,AtClient.put,AtClient.putText,AtClient.putBinary,AtClient.putMetaandAtClient.delete - ReservedEntityValidation
- Verifies if the key belongs to reserved key list.
- ResolutionContext
- Response
- SecondaryAddress
- SecondaryAddressFinder
- SecretSharingAlgos
- Registry of the algorithm identifiers used in per-APKAM key packages and secret envelopes.
- SecureSocketConfig
- class to store configuration to create a security context while creating secure sockets
- SelfKey
- Represents a Self key.
- ServerMutexLease
- A server mutex this client took, valid until expiresAt.
-
SetKeyStream<
T> - Class to expose a stream of Set<AtKey> based on the provided query parameters
- Represents a key shared to another atSign.
- SignalsPrivateFiling
- Implemented by an NskeyKeyRing that can say when a private half arrives.
- SignedEnvelope
- A signed envelope: RFC 7515 general JSON serialization, and the only shape this build signs or verifies.
- StringBuffer
-
SubSpec<
U> - Immutable description of one level in a sub-collection tree. Used with Query.watchWithTree to declare a parent → children → ... shape that the library will live-orchestrate.
- SwitchAtSignEvent
- SymmetricAesGcmProvider
- Layer 3 of the nskey data path: application data, AES-256-GCM under a content key.
- SyncEntry
- SyncProgress
- SyncProgressListener
- SyncRequest
- SyncResult
- SyncService
-
TreeNode<
T> - One node in the snapshot returned by Query.watchWithTree. Carries the parent CItem<T> and the per-sub-collection branches — each branch keyed by its SubSpec.subName and holding the current list of children at that level (which are themselves TreeNodes, recursing all the way down).
-
Tuple<
T1, T2> - UpdateParams
- Validation
- Implement a validation on a key
- ValidationContext
- Represents context of a validation See AtKeyValidator
- ValidationResult
-
Represents outcome of a key validation
See AtKeyValidator and
AtConcreteKeyValidator - VerbSyntax
- VerbUtil
-
WithChildren<
P, C> - One row in the snapshot returned by Query.watchWithSub — a parent CItem<P> alongside the current list of its children CItem<C> from a single named sub-collection.
- WrittenAtKeysIo
- An interface that defines methods for AtKeys that can be written. It can be implemented by classes that write AtKeys to different sources, such as file system or keychain.
Enums
- AtConnectionCause
- Why a connection is not AtConnectionOutcome.online.
- AtConnectionOutcome
- How far a client got towards its atServer.
- AtKeysUnusableCause
- Why an atSign's keys cannot be used to authenticate as it.
- AtMessage
- AtReachability
-
Why
AtClient.ensureReachableanswered as it did. - AtRpcRespType
- The types of responses which the responder can send back to the requester
- AtSignServerState
- Where an atSign stands, as the atDirectory and its atServer report it.
- ChainVerdict
- How far up the chain a walk from one key got.
- CollectionOp
- EnrollmentKeyExchangeMode
-
How an enrollment's
apkamSymmetricKeygets from one side to the other. - EnrollmentStatus
- EnrollOperationEnum
- EnvelopeRefusal
- Why an envelope was refused.
- EventSource
-
Selects which underlying source(s) an AtCollection consumes its
CItemUpdated/CItemDeleted/CSubItemUpdated/CSubItemDeletedevents from. - ExceptionScenario
- Intent
- KeyType
- MessageTypeEnum
- NotificationListenerState
- NotificationStatusEnum
- OperationEnum
- PkamAuthMode
- PredicateOp
-
Comparison operator carried by a CmpPredicate. Stored as a value
(rather than encoded in the subclass) so
switchover op stays exhaustive at evaluation time and indexed-executor pushdown can pattern-match on it. - PriorityEnum
- RegexGroup
- Represents groups with in Regexes See Regexes
- RemoteLocalPref
-
Where an operation goes when the call leaves
useRemoteAtServerunset; see AtClientPreference.remoteLocalPref. - ReservedKey
- ResolutionStrategy
- SigningAlgoType
- StrategyEnum
- SyncDirection
- SyncRequestSource
-
Identifies the origin of a SyncRequest. Every sync request is
idempotent — "what to push" is owned by
LocalSecondary'sAtSyncQueue, so requests are just "please drain" triggers: a round answers every request queued when it reads the atServer. - SyncStatus
- Enum to represent the sync status.
- SyncType
Extension Types
- Atsign
- A fully qualified atSign (e.g. @alice)
- AtsignWithoutAt
- An atSign without the "@" (e.g. alice)
- KeyEntryStatus
- Whether an advertised key entry is still offered for new operations.
- NskeyDecapsulationKey
-
An nskey generation's decapsulation key: the expanded form
pqOpenopens conveyances with — derived from an NskeySeed, held in memory, never filed and never conveyed. - NskeySeed
- An nskey generation's seed: the compact form the whole keypair re-derives from — the ONLY form that may be filed durably or conveyed to another enrollment.
Extensions
- AtClientEnrollments on AtClient
-
client.enrollments: the approving side of enrollment. - AtMessageExtension on AtMessage
- AtsignLifecycle on Atsign
- The verbs an application reaches a working client through, on the atSign it holds keys for.
- AtsignString on String
- CItemPrettyString on CItem
-
Multi-line human-readable dump of a CItem — useful for
example-app logging and debugging. Reads at the call site as
item.prettyString. -
ComparablePathField
on PathField<
V> -
<,<=,>,>=for fields whose value is Comparable. -
NullablePathField
on PathField<
V?> -
Null checks for fields whose declared value type is nullable.
Declare the field as
PathField<Foo?>to opt in. - NullCheck on String?
- Extending the String class to check null and empty.
- NullOrEmptyCheck on String?
- Extending the String class to check null and empty.
- ParseEncodingTypeToString on EncodingType
-
Parse
EncodingTypeto String - ReceivedSchemes on AtClient
- Tells how values shared with this client were protected.
- RegexGroupToString on RegexGroup
- ServerMutex on AtClient
- Short-lived locks shared by every client of an atSign, held on its atServer.
- SyncServiceWaitUntilCaughtUp on SyncService
- Adds waitUntilCaughtUp to every SyncService without forcing existing implementers to add a method to satisfy a new abstract member. Implemented as an extension (not a method on SyncService or a mixin) so:
Constants
- defaultSupersededCkGrace → const Duration
- How long a superseded content key is kept, by default, once the key that replaced it was cut: the longest an atServer keeps a notification.
- error_codes → const Map
- error_description → const Map
- jsonPrettyPrinter → const JsonEncoder
- legacyCryptoProviderId → const String
-
The id of the built-in legacy (pre-pluggable) encryption scheme — the
default provider and the fallback for records with no
appMetadata. - maxMessageTextLength → const int
- The longest stretch of text from outside the process that an exception message carries, counted as written, escapes included.
- maxPublishedApskLength → const int
-
The longest
_apskvalue verifySignedEnvelope reads, in UTF-8 bytes: 512 KiB. - maxServerMutexTtl → const Duration
- The longest a server mutex may be held.
- mlKemNskeyCryptoProviderId → const String
- Wire id of the CK-conveyance provider for the no-hybrid KEM.
- nskeyAdvertisementVersion → const int
- The version stamped on the nskey advertisement payload.
- nskeyCryptoProviderId → const String
- Wire id of the CK-conveyance provider that seals to an X-Wing nskey.
- nskeyProviderFamily → const String
- The role prefix every CK-conveyance scheme shares, whatever its algorithms.
-
pqCryptoProviderIds
→ const Set<
String> - Every provider id this SDK ships for the post-quantum data path.
- readReceiptNamespacePart → const String
- Constant for the read-receipt sub-collection's reserved namespace part. Tests assert against this when constructing expected envelope keys.
- symmetricAesGcmCryptoProviderId → const String
- Wire id of the application-data provider.
Functions
-
buildAtClient(
{required String atSign, required AtClientPreference preference, String? namespace, required AtClientStorage storage, required AtKeysIo atKeysIo, String? enrollmentId, AtLookUp? atLookUp, required AtLookUpFactory lookUps, required SecondaryAddressFinder secondaryAddressFinder, FutureOr< NotificationService> notificationServiceBuilder(AtClient)?, FutureOr<SyncService> syncServiceBuilder(AtClient)?, FutureOr<EnrollmentService> enrollmentServiceBuilder(AtClient)?}) → Future<AtClient> -
Builds a client for
atSignand wires its notification, sync and enrollment services. -
checkAtSignServer(
AtLookUp lookUp, String atSign, {Duration? timeout}) → Future< AtSignServerCheck> -
Asks, over
lookUp, whetheratSignis in the atDirectory, whether its atServer answers, and whether the atSign has been activated. -
classifyConnectionFailure(
Object error) → AtConnectionState? -
What
errorsays about the connection, or null when it says nothing: a key that was not found, a value that failed to parse, a privilege the enrollment lacks all mean the atServer answered, and the classification for those is AtConnectionState.online, while an error about the caller's own arguments says nothing at all. -
clearFactoriesForTest(
) → void -
Clears the process-global factory registry so tests can start from
a known empty state. The registry is a
staticcache on AtCollection used byregisterFactory/setUpFromAtSign; tests call this in setUp/tearDown to avoid cross-test pollution. -
clearMissingFactoryWarningsForTest(
) → void -
Clears the warned-tag set used to suppress repeated
missing factory for type taglog lines. -
clipForMessage(
String text, {int maxLength = maxMessageTextLength, String? quote}) → String -
textas it may appear in a one-line exception message. -
cmpPredicateForTest(
PathField field, PredicateOp op, Object? value) → CmpPredicate - Builds a CmpPredicate with the given parts, bypassing the PathField operator path. Tests use this to exercise reserved PredicateOp values that don't yet have a corresponding operator.
-
collectConveyedKeyMaterial(
AtClient atClient, AtKeysIo keysIo, {NskeyKeyRing? ring}) → Future< int> -
Collects the secrets this enrollment has been sent and files the key
material among them into
keysIo. Returns how many nskey privates were filed. -
collectionWithInjectedBoth<
T> (AtClient atClient, String namespace, Duration defaultExpiration, {required Stream< AtNotification> notifications, required Stream<DataEvent> dataEvents, T fromJson(Map<String, dynamic> )?, String? typeTag, String? writeTypeTag}) → AtCollection<T> - Constructs an AtCollection<T> on the EventSource.both path with both source streams injected: tests drive each path independently and assert un-deduplicated dual emission.
-
collectionWithInjectedDataEvents<
T> (AtClient atClient, String namespace, Duration defaultExpiration, {required Stream< DataEvent> dataEvents, T fromJson(Map<String, dynamic> )?, String? typeTag, String? writeTypeTag}) → AtCollection<T> - Constructs an AtCollection<T> with an injected DataEvent stream — the data-events analogue of collectionWithInjectedNotifications. Lets tests drive the EventSource.data path without a live LocalSecondary stream subscription.
-
collectionWithInjectedNotifications<
T> (AtClient atClient, String namespace, Duration defaultExpiration, {required Stream< AtNotification> notifications, T fromJson(Map<String, dynamic> )?, String? typeTag, String? writeTypeTag}) → AtCollection<T> -
Constructs an AtCollection<T> with an injected notification
stream — required so tests drive notification events without an
active server connection. Callers supply
notifications(typically aStreamController.broadcast()they own); the produced collection subscribes to it as if it were the live monitor stream. -
convertCommitOpSymbolToEnum(
String commitOpSymbol) → CommitOp -
getEnrollOperation(
EnrollOperationEnum? enrollOperationEnum) → String -
getEnrollStatusFromString(
String value) → EnrollmentStatus -
getMessageType(
MessageTypeEnum? messageTypeEnum) → String -
getOperationName(
OperationEnum? d) → String -
getPriority(
PriorityEnum? priorityEnum) → String -
getStrategy(
StrategyEnum? strategyEnum) → String -
handleDataEventForTest(
AtCollection coll, DataEvent event) → Future< void> -
Routes
eventthroughcoll's data-event handler — the same entry point the live LocalSecondary subscription uses on the EventSource.data path. -
handleNotificationForTest(
AtCollection coll, AtNotification n) → Future< void> -
Routes
nthroughcoll's top-level notification handler — the same entry point the live monitor subscription uses. -
handleObjNotificationForTest(
AtCollection coll, AtNotification n) → Future< void> -
Routes
nthroughcoll's value-event branch directly — bypasses the regex dispatcher; tests exercise the value-handler in isolation. -
handleSubObjNotificationForTest(
AtCollection coll, AtNotification n) → Future< void> -
Routes
nthroughcoll's sub-collection-event branch directly. -
neverRotateNskey(
NskeyRotationContext ns) → bool - An NskeyRotationPolicy that never replaces a namespace key on its own, leaving rotation to revocation and to the application.
-
nskeyAdvertisementKey(
String owner, String namespace) → AtKey - The at-key an nskey's public half is published under.
-
nskeyKidOf(
Uint8List publicKey) → String - The id of an nskey generation — a SHA-256 prefix of its public half, so it is derivable by anyone holding the key and identical for every party that uses it.
-
nskeyProviderIdFor(
String keyAlgo) → String? -
The provider id that conveys a content key sealed to a
keyAlgonskey, or null for an algorithm this build cannot seal to. -
openSubSpecForTest<
T, U> (SubSpec< U> spec, AtCollection<T> parentColl, CItem<T> parentItem) → AtCollection<U> -
Opens
speconparentItemusingparentColl's context. Test-only because the production call-site is hidden behind AtCollection.subCollection — the spec object isn't directly constructed by app code. -
requestAndFileNskeyPrivate(
PairwiseSecretSharing sharing, NskeyPrivateFiling? filing, String namespace, String secretName, {required AtSignLogger logger, Duration timeout = NskeyPrivateFiling.conveyanceWait}) → Future< void> - Asks this atSign's other enrollments for one missing nskey private, then waits for a holder to answer and files the answer.
-
rotateCkAfterOneWeek(
CkRotationContext ck) → bool - A CkRotationPolicy that replaces a content key once it is a week old.
-
rotateCkAfterOneYear(
CkRotationContext ck) → bool - The default CkRotationPolicy: replace a content key once it is a year old.
-
rotateNskeyAfterOneYear(
NskeyRotationContext ns) → bool - The default NskeyRotationPolicy: replace a namespace key once its advertisement says it was minted a year ago.
-
secureSocketLookUps(
{SecureSocketConfig? config, Future< void> onConnect(AtCommandExecutor connection)?}) → AtLookUpFactory -
The default AtLookUpFactory: every connection over TLS on TCP, under
config(the TLS defaults with none), throughAtLookUp.withSecureSocket. -
selectEnvelopeKey(
SignedEnvelope envelope, {required PublishedApsk signer, SigningAlgoType? minimumAlgorithm}) → EnvelopeKeySelection - Makes every check verifySignedEnvelope makes except the signature, and reads neither the payload nor any key material; never throws.
-
subCollectionWithInjectedNotifications<
T, U> (AtCollection< T> parent, {required CItem<T> parentItem, required String subName, required Duration defaultExpiration, required Stream<AtNotification> notifications, U fromJson(Map<String, dynamic> )?, String? typeTag, String? writeTypeTag}) → AtCollection<U> -
Constructs a sub-collection of
parentwith an injected notification stream. Same semantics as collectionWithInjectedNotifications but for nested collections. -
verifySignedEnvelope(
SignedEnvelope envelope, {required PublishedApsk signer, SigningAlgoType? minimumAlgorithm}) → Future< EnvelopeVerification> -
Checks that
envelopeis an application envelope that namessigner's Atsign and enrollment and is signed with a client data signing keysignerlists, underminimumAlgorithmor stronger when given, without anAtClient, the network or a clock; never throws.
Typedefs
- AtLookUpFactory = AtLookupMuxable Function({required String atSign, required AtAuthenticator? authenticator, required AtRootDomain rootDomain, SecondaryAddressFinder? secondaryAddressFinder})
- Builds the connection a client uses to reach an atServer: what an application hands the entry points so that every connection the client opens - its own, its sync's, its monitor's - travels the way the application chose.
-
CkRotationPolicy
= FutureOr<
bool> Function(CkRotationContext ck) - Whether the content key for a destination and namespace should be replaced before anything else is written under it.
- DroppedNotification = ({String key, String reason})
- A notification NotificationService.droppedEvents reports as given up on: its key, empty when the frame could not be parsed into one, and the reason logged for it.
- FiledNskeyPrivate = ({String namespace, String nskeyKid, String owner})
- A record identifying one filed nskey private, as SignalsPrivateFiling reports it.
- FiledNskeySeed = ({DateTime createdAt, String keyAlgo, String nskeyKid, NskeySeed seed})
- One private filed for a namespace: the generation it opens, its seed, the algorithm it expands under, and when it was filed.
-
LinkWrite
= ({Map<
String, Object?> ? expect, Map<String, Object?> link}) - A link this client has signed for one key, with the link it found on that key when it read the record, or null when it found none.
-
NskeyAfterPublish
= Future<
NskeyAdvertisement?> Function(NskeyAdvertisement published, NskeyRotateHoldingLease rotate) - What a mint or a rotation runs once its advertisement is published, handed that advertisement and a rotation under the lock it still holds; answers the generation published after it, or null when it published nothing more.
-
NskeyRotateHoldingLease
= Future<
NskeyAdvertisement> Function({Future<void> afterPublish(NskeyAdvertisement published)?, Future<void> conveyFirst(List<String> nskeyKids)?}) -
Rotates onto a fresh generation under the mint lock the caller's mint still
holds, conveying through
conveyFirstand then runningafterPublishas a mint does. -
NskeyRotationOutcome
= ({NskeyAdvertisement advertisement, int conveyedTo, Set<
String> excluded, String namespace, String supersededKid}) - What one namespace's rotation did.
-
NskeyRotationPolicy
= FutureOr<
bool> Function(NskeyRotationContext ns) - Whether the namespace key should be replaced before it is used again.
-
ResolvedNskey
= ({String alg, String namespace, String nskeyKid, List<
int> publicKey}) - An nskey found for a namespace, and the namespace it was actually found at.
-
RpcRequestHandler
= Future<
AtRpcResp> Function(AtRpcReq request, String fromAtSign)
Exceptions / Errors
- AtAuthErrorReplyException
-
An atServer's
error:reply to afrom:,pkam:orcram:, which ended the authentication: the message carries the reply. - AtBufferOverFlowException
- AtCertificateValidationException
- Exception thrown when security certification validation on root or secondary server fails
- AtClientException
- AtConnectException
- The class AtConnectException and its subclasses represent any issues that prevents an connection to the root or the secondary server
- AtCredentialRefusedException
-
openwas refused, and this device holds nothing for the principal, so there is no client to hand back: the first open of a principal on a device must be online. - AtDecryptionException
- AtEncryptionException
- AtEnrollmentCancelledException
- The wait PendingEnrollment.awaitApproval or PendingEnrollment.client was in ended because its request was cancelled: by PendingEnrollment.cancel, or by another PendingEnrollment for the same request, in this process or another, before the approval was filed.
- AtEnrollmentDeniedException
- The atServer denied the enrollment an enrollment wait was waiting on (AT0025), so no approval can follow.
- AtEnrollmentException
- Exception thrown for enrollment related exceptions
- AtEnrollmentExpiredException
- The enrollment an enrollment wait was waiting on has expired, or its atServer no longer holds it, so no approval can follow.
- AtEnrollmentPendingException
-
openwas asked to open a keyfile that holds nothing but an enrollment awaiting approval, so there is no credential to authenticate with yet.Atsign.resumeEnrollmentis the way to pick it up. - AtEnrollmentRevokeException
- Exception thrown when a client tries to revoke its own enrollment
- AtException
- The class AtException and its subclasses represents various exceptions that can arise while using the Atsign Protocol.
- AtInvalidEnrollmentException
- Exception thrown when an Enrollment_id is expired or invalid
- AtIOException
- Exception thrown when there is any issue related to socket operations e.g read/write
- AtKeyException
- AtKeyNotFoundException
- AtKeysFormatException
- An atKeys document that is not a JSON object, or not one of the shape it must have: reason says why, in the JSON parser's words when it did not parse, and position is the 1-based character where the parser stopped.
- AtKeysPassphraseException
- A passphrase envelope refused for its passphrase: none was given, or the one given does not open it. Every other refusal of an envelope, such as a version or key derivation this build cannot use, is a plain AtDecryptionException whose message says what is wrong.
- AtKeysUnusableException
- Keys that cannot be used to authenticate as atSign: cause says why, and source where they were looked for.
- AtNoCredentialException
-
openwas asked to open a keyfile that holds no credential and no pending enrollment, as a denial, a cancel or an expiry leaves it, so there is nothing to authenticate with: the device has to enroll again. - AtOpenRefusedException
- AtPrivateKeyNotFoundException
- AtPublicKeyChangeException
- AtPublicKeyNotFoundException
- AtServerException
- AtSigningException
- Exception thrown for issues occurring during data signing or pkam signing operations.
- AtSigningVerificationException
- Exception thrown for issues occurring during data signing verification or pkam signing verification operations.
- AtStorageInUseException
- A store at location is held open by another process, so this one cannot open it: give each process a location of its own.
- AtThrottleLimitExceeded
- Exception thrown when the enrollment requests exceed the limit in the given time window
- AtTimeoutException
- Exception thrown when no response is received before the timeout duration
- AtValueException
- BlockedConnectionException
- BufferOverFlowException
- Exception thrown when data size passed to the socket is greater than configured buffer size
- CItemReadException
- A record a collection could not read, such as one sealed to a key this device does not hold yet: yielded as an error by AtCollection.getItemsAsStream, with the stack its read failed on.
-
CollectionOpException<
T> - Thrown by AtCollection.create / AtCollection.update / AtCollection.delete when any key-level op failed. Inspect results for the per-key breakdown, or failures / firstFailure for the subset that went wrong.
- ConnectionInvalidException
- Thrown when trying to perform a read/write on a connection which is invalid
- The value cites a CK this client cannot resolve yet.
- CryptoProviderNotRegistered
- EnrollmentConveyanceException
- An approval whose server-side approve succeeded but whose conveyance refused the advertised key package (KeyPackageStatus.rejected) — the enrollment is live and will be unable to decrypt anything, and the approver can revoke it.
- HandShakeException
- Exception thrown when from-pol handshake fails between two secondary servers
- IllegalArgumentException
- Exception thrown when any parameter in a verb command is invalid
- IllegalStateException
- Exception thrown when a verb fails due to some state being not as expected
- InboundConnectionLimitException
- Thrown when current server's inbound connection limit is reached
- InternalServerError
- Thrown for any unhandled server error
- InternalServerException
- Thrown for any unhandled server exception
- InvalidAtKeyException
- Exception thrown when a key is invalid
- InvalidAtSignException
- Exception thrown when an atsign name provided is invalid.
- InvalidDataException
- Exception thrown when data provided to a method is invalid.
- InvalidPinException
- InvalidRequestException
- Exception thrown when request to secondary server is invalid
- InvalidResponseException
- Exception thrown when response from secondary server is invalid e.g invalid json format
- InvalidSyntaxException
- Exception thrown when an Atsign Protocol verb has an invalid syntax.
- KeyNotFoundException
- Exception thrown when AtKey.key is not present in the keystore
- LegacyEncryptionRefusedException
- A write would have been encrypted with the legacy provider, and this client was told never to do that (AtClientPreference.disallowLegacyEncryption).
- LookupException
- Thrown when lookup fails after handshake
- atSign has no published nskey for namespace, so nothing can be sealed to it under the post-quantum path.
- NskeyPrivateNotHeldException
- This client was asked to seal a content key to its own atSign's nskey generation nskeyKid without holding that generation's private half.
- A record was sealed to an nskey generation whose private half this client does not hold yet.
- OutBoundConnectionInvalidException
- Thrown when trying to perform a read/write on an outbound connection which is invalid
- OutboundConnectionLimitException
- Thrown when current server's outbound connection limit is reached
- RootServerConnectivityException
- Exception thrown when there is an issue connecting to root server
- SecondaryConnectException
- Exception thrown when an atsign's secondary url cannot be reached or is unavailable Should this be extending AtConnectException?
- SecondaryNotFoundException
- Exception thrown when the requested atsign's secondary url is not present in Root server
- SecondaryServerConnectivityException
- Exception thrown when there is an issue connecting to secondary server
- SelfKeyNotFoundException
- ServerIsPausedException
- Thrown when a request is received on a connection while the server is paused
- StoppedException
-
Thrown by work whose owner has stopped: an operation of an
AtClientthat has been stopped, or any call on an at_lookup connection its owner has stopped. - UnAuthenticatedException
- Thrown when trying to perform a verb execution which requires authentication
- UnAuthorizedException
- Exception thrown when a client tries to execute a verb or establish a connection but doesn't have the required permissions