code: public byte[] getEncoded() throws SshException {
  		ByteArrayWriter baw = new ByteArrayWriter();
  		try {
  
  			baw.writeString(getAlgorithm());
  			baw.writeBigInteger(pubKey.getPublicExponent());
  			baw.writeBigInteger(pubKey.getModulus());
  
  			return baw.toByteArray();
  		} catch (IOException ex) {
  			throw new SshException("Failed to encoded key data",
  					SshException.INTERNAL_ERROR, ex);
  		} finally {
  			try {
  				baw.close();
  			} catch (IOException e) {
  			}
  		}
  	}
docs: /*
  (non-Javadoc)
  
  @see com.sshtools.ssh.publickey.RsaPublicKey#getEncoded()