publicKeyFromBytes method

SimplePublicKey publicKeyFromBytes(
  1. Uint8List bytes
)

Creates a public key from raw bytes.

bytes - 32-byte public key.

Throws ArgumentError if bytes is not 32 bytes.

Implementation

SimplePublicKey publicKeyFromBytes(Uint8List bytes) {
  if (bytes.length != 32) {
    throw ArgumentError('Public key must be exactly 32 bytes for Ed25519');
  }
  return SimplePublicKey(bytes, type: KeyPairType.ed25519);
}