code: public byte[] sign(byte[] nonce) {
          try {
              char[] keyChars = this.readKeyChars();
              NKey nkey =  NKey.fromSeed(keyChars);
              byte[] sig = nkey.sign(nonce);
              nkey.clear();
              return sig;
          } catch (Exception exp) {
              throw new IllegalStateException("problem signing nonce", exp);
          }
      }
docs: Sign is called by the library when the server sends a nonce.
  The client's NKey should be used to sign the provided value.
  
  @param nonce the nonce to sign
  @return the signature for the nonce