publicKey property

  1. @override
EncryptKey? get publicKey
override

Gets the user's public encryption key.

This key is used by other users to encrypt messages sent to this user.

Implementation

@override
EncryptKey? get publicKey {
  EncryptKey? visaKey = _key;
  if (visaKey == null) {
    Object? info = getProperty('key');
    // assert(info != null, 'visa key not found: ${toMap()}');
    PublicKey? pKey = PublicKey.parse(info);
    if (pKey is EncryptKey) {
      visaKey = pKey as EncryptKey;
      _key = visaKey;
    } else {
      assert(info == null, 'visa key error: $info');
    }
  }
  return visaKey;
}
  1. @override
set publicKey (EncryptKey? publicKey)
override

Sets the user's public encryption key.

@param pKey - New public key for message encryption

Implementation

@override
set publicKey(EncryptKey? publicKey) {
  setProperty('key', publicKey?.toMap());
  _key = publicKey;
}