PubkeyException.length constructor

PubkeyException.length(
  1. int length, {
  2. int maxLength = nacl.pubkeyLength,
})

Creates an exception for an invalid public key length.

The error message is constructed from the invalid key's length and the maxLength of a public key.

  /// [message] = 'Invalid public key length of 16, expected 32.'
  throw PubkeyException.length(16, maxLength: 32);

Implementation

factory PubkeyException.length(
  final int length, {
  final int maxLength = nacl.pubkeyLength,
}) => PubkeyException('Invalid public key length of $length, expected $maxLength.');