copy method

  1. @override
SimpleKeyPairData copy()
override

Returns a copy of this object.

The copy is not affected by destroy.

Implementation

@override
SimpleKeyPairData copy() {
  if (hasBeenDestroyed) {
    throw StateError('Private key has been destroyed');
  }
  final bytes = _bytes;
  if (bytes.hasBeenDestroyed) {
    throw _destroyedError();
  }
  return SimpleKeyPairData(
    Uint8List.fromList(bytes),
    publicKey: publicKey,
    type: type,
    debugLabel: debugLabel,
  );
}