validateKeyBits static method
Throws an error on invalid bytes and return the bytes itself anyway
Implementation
static Uint8List validateKeyBits(Uint8List bytes) {
var valid = ((bytes[0] & 7) == 0) && ((bytes[31] & 192) == 64);
if (bytes.length < 32 || !valid) {
throw InvalidSigningKeyError();
}
return bytes;
}