deserialize method

  1. @override
void deserialize(
  1. SerializableInput input
)
override

Interface for intput serialization.

Implementation

@override
void deserialize(SerializableInput input) {
  Uint8List nullTerminatedMagic = input.getBytes(15);
  magic = String.fromCharCodes(nullTerminatedMagic, 0, 14);
  if (magic != 'openssh-key-v1') throw FormatException('wrong magic: $magic');

  ciphername = deserializeString(input);
  kdfname = deserializeString(input);
  kdfoptions = deserializeStringBytes(input);
  publickeys = List<Uint8List>(input.getUint32());
  for (int i = 0; i < publickeys.length; i++) {
    publickeys[i] = deserializeStringBytes(input);
  }
  privatekey = deserializeStringBytes(input);
}