utils library

Functions

assertNullOrValidMapValue(Map m, String k, Type t) → void
Assert that the value for key k in Map m is non-null and is of Type t. Throws an ArgumentError if the value is null, or is not of Type t.
assertNullOrValidValue(String name, dynamic v, Type t) → void
assertValidMapValue(Map m, String k, Type t) → void
Assert that the value for key k in Map m is non-null and is of Type t. Throws an ArgumentError if the value is null, or is not of Type t.
assertValidValue(String name, dynamic v, Type t) → void
atSignIsActivated(AtClient atClient, String atSign) Future<bool>
Checks if the provided atSign's atServer has been properly activated with a public RSA key. atClient must be authenticated atSign is the atSign to check Returns true, if the atSign's cloud secondary server has an existing public:publickey@ in their server, Returns false, if the atSign's cloud secondary exists, but does not have an existing public:publickey@ Throws AtClientException if the cloud secondary is invalid or not reachable
clearLocallyCachedPKs({required AtSignLogger logger, FileSystem? fs, AtClient? atClient}) Future<void>
Remove all PKs which this atSign has cached in filesystem or in atClient storage
getLocallyCachedPK(AtClient atClient, String atSign, {FileSystem? fs}) Future<String>
If the PK for atSign is in the sshnp local cache, then return it. If it is not, then fetch it via the atClient, and store it.
invalidDeviceName(String test) bool
Returns false if the device name does not match sshnpDeviceNameRegex
isUnprintable(int codeUnit) bool
signAndWrapAndJsonEncode(AtClient atClient, Map payload) String
snakifyDeviceName(String deviceName) String
Returns deviceName with uppercase latin replaced by lowercase, and whitespace replaced with underscores. Note that multiple consecutive whitespace characters will be replaced by a single underscore.
verifyEnvelopeSignature(AtClient atClient, String requestingAtsign, AtSignLogger logger, Map envelope, {FileSystem? fs}) Future<void>

Typedefs

SrvGenerator<T> = Srv<T> Function(String, int, {String? aesC2D, String? aesD2C, bool? bindLocalPort, Duration? controlChannelHeartbeat, bool detached, String? ivC2D, String? ivD2C, String? localHost, int? localPort, bool multi, required RelayAuthenticator? relayAuthenticator, Duration timeout})