KeyExchangeWand class abstract

An opaque object that has some key pair and support for sharedSecretKey.

You can extract the PublicKey with extractPublicKey. The private key is not extractable.

Example

import 'package:cryptography/cryptography.dart';

Future<void> main() async {
  final x25519 = X25519();
  final aliceWand = await x25519.newKeyExchangeWand();
  final bobPublicKey = await (await x25519.newKeyPair()).extractPublicKey();
  final secretKey = await aliceWand.sharedSecretKey(
    remotePublicKey: bobPublicKey,
  );
}
Inheritance

Constructors

KeyExchangeWand.constructor()
Constructor for subclasses.

Properties

hasBeenDestroyed bool
Whether destroy has been called.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

destroy() Future<void>
Prevents this object from being used anymore and attempts to erase cryptographic keys from memory.
inherited
extractPublicKey() Future<PublicKey>
Extracts the public key is used for key exchanges.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sharedSecretKey({required PublicKey remotePublicKey}) Future<SecretKey>
Computes the shared secret key that this and the other party can compute using public keys known to each other.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited