infra_did_comm_dart library

Classes

Context
Represents the context of an action in a domain.
DIDAuthFailedMessage
Represents a DID Auth Failed message.
DIDAuthInitMessage
Represents a DID Auth Init message.
DIDAuthMessage
Represents a DIDAuth message.
DIDConnectedMessage
Represents a DID Connected message.
DIDConnectRequestMessage
Represents a DID Connect Request message.
InfraDIDCommAgent
Represents an InfraDIDComm agent that can connect to other agents and exchange messages.
Initiator
Represents an Initiator in the communication process.
RejectRequestVPMessage
RejectRequestVPResponseMessage
RequestVC
RequestVCQuery
SubmitVPLaterMessage
SubmitVPLaterResponseMessage
SubmitVPMessage
SubmitVPResponseMessage
VPRequestMessage

Enums

CompressionLevel
Enum representing the compression levels for data.
VPRequestResponseType

Functions

decodeJWS(String token) → dynamic
Decodes the provided JWS token and returns the payload.
decryptJWE(String jweCompact, Map<String, dynamic> key) Future<String>
Decrypts the provided jweCompact using the specified key. Returns the decrypted payload as a string.
deflateAndEncode(Map<String, dynamic> data) String
Deflates and encodes the given data map into a base64 URL-encoded string.
didConnectRequestLoop(InfraDIDCommAgent agent, Context context, int loopTimeSeconds, dynamic loopCallback(String encodedMessage)) Future<void>
Executes a loop that sends DIDConnectRequestMessage to the agent until a DIDAuthInit message is received.
encryptJWE(String data, Map<String, dynamic> key, {Map<String, dynamic>? epk}) String
Encrypts the provided data using the specified key and optional epk. Returns the compact serialization of the encrypted JWE.
extendedPrivateKeyFromSeed(String seed) List<int>
Converts a seed to an extended private key.
extendedPrivateKeyFromUri(String uri) Future<List<int>>
Converts a URI to an extended private key.
extractJWEHeader(String jweCompact) Map<String, dynamic>
Extracts and returns the header of the provided jweCompact as a map.
generateX25519EphemeralKeyPair() Future<(List<int>, List<int>)>
Generates a X25519 ephemeral key pair. Returns a Future that completes with a tuple containing the private key and the public key.
inflateAndDecode(String encoded) Map<String, dynamic>
Inflates and decodes the given encoded base64 URL-encoded string into a map.
jwkFromSharedKey(List<int> sharedKey) Map<String, dynamic>
Converts a shared key to a JWK (JSON Web Key) representation. Returns the JWK.
makeJWEFromMessage(String mnemonic, String receiverDID, InfraDIDCommAgent agent, Map<String, dynamic> jsonMessage) Future<String>
makeSharedKey(List<int> privateKey, List<int> publicKey) Future<List<int>>
Makes a 32-byte shared key from the private key and the public key. Returns a Future that completes with the shared key.
privateKeyFromUri(String uri) Future<List<int>>
Converts a URI to a private key.
privateKeyfromX25519Jwk(Map<String, dynamic> jwk) List<int>
Converts a X25519 JWK (JSON Web Key) to a X25519 private key. Returns the X25519 private key.
publicKeyFromAddress(String address) List<int>
Converts an address to a public key.
publicKeyFromSeed(String seed) List<int>
Converts a seed to a public key.
publicKeyFromUri(String uri) Future<List<int>>
Converts a URI to a public key.
publicKeyfromX25519Jwk(Map<String, dynamic> jwk) List<int>
Converts a X25519 JWK (JSON Web Key) to a X25519 public key. Returns the X25519 public key.
signJWS(String data, String privateKey) String
Signs the provided data using the private key and returns a JSON Web Signature (JWS) token.
verifyJWS(String token, String publicKey) → dynamic
Verifies the provided JWS token using the public key and returns the payload if the verification is successful.
x25519JwkFromEd25519PrivateKey(List<int> privateKey) Future<Map<String, dynamic>>
Converts an Ed25519 private key to a X25519 private key and then to a JWK (JSON Web Key) representation. Returns a Future that completes with the JWK.
x25519JwkFromEd25519PublicKey(List<int> publicKey) Map<String, dynamic>
Converts an Ed25519 public key to a X25519 public key and then to a JWK (JSON Web Key) representation. Returns the JWK.
x25519JwkFromX25519PrivateKey(List<int> privateKey) Future<Map<String, dynamic>>
Converts a X25519 private key to a JWK (JSON Web Key) representation. Returns a Future that completes with the JWK.
x25519JwkFromX25519PublicKey(List<int> publicKey) Map<String, dynamic>
Converts a X25519 public key to a JWK (JSON Web Key) representation. Returns the JWK.