fromString method

KeyPair fromString(
  1. String keys
)

Creates a KeyPair object from a space-separated string containing a public key and a private key.

Parameters:

  • keys A space-separated string containing a public key and a private key.

Returns: A KeyPair object created from the provided string.

Implementation

KeyPair fromString(String keys) {
  List<String> keyParts = keys.split(' ');
  publicKey = keyParts[0];
  privateKey = keyParts[1];
  return this;
}