## net.i2p.router.tunnel
Class BuildMessageGenerator

    java.lang.Object
      net.i2p.router.tunnel.BuildMessageGenerator

    public class BuildMessageGenerator

extends java.lang.Object

Field Summary
`static java.lang.Integer[]` `ORDER`

Constructor Summary
`BuildMessageGenerator()`

Method Summary
`TunnelBuildMessage` `createInbound(RouterContext ctx, TunnelCreatorConfig cfg)` return null if it is unable to find a router's public key (etc)
`TunnelBuildMessage` `createOutbound(RouterContext ctx, TunnelCreatorConfig cfg, Hash replyRouter, long replyTunnel)` return null if it is unable to find a router's public key (etc)
`void` `createRecord(int recordNum, int hop, TunnelBuildMessage msg, TunnelCreatorConfig cfg, Hash replyRouter, long replyTunnel, I2PAppContext ctx, PublicKey peerKey)` Place the asymmetrically encrypted record in the specified record slot, containing the hop's configuration (as well as the reply info, if it is an outbound endpoint)
`static boolean` `isBlank(TunnelCreatorConfig cfg, int hop)`
`void` `layeredEncrypt(I2PAppContext ctx, TunnelBuildMessage msg, TunnelCreatorConfig cfg, java.util.List order)` Encrypt the records so their hop ident is visible at the appropriate times

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ORDER

    public static final java.lang.Integer[] ORDER

Constructor Detail

### BuildMessageGenerator

    public BuildMessageGenerator()

Method Detail

### createInbound

    public TunnelBuildMessage createInbound(RouterContext ctx,
                                            TunnelCreatorConfig cfg)

  return null if it is unable to find a router's public key (etc)

### createOutbound

    public TunnelBuildMessage createOutbound(RouterContext ctx,
                                             TunnelCreatorConfig cfg,
                                             Hash replyRouter,
                                             long replyTunnel)

  return null if it is unable to find a router's public key (etc)

### createRecord

    public void createRecord(int recordNum,
                             int hop,
                             TunnelBuildMessage msg,
                             TunnelCreatorConfig cfg,
                             Hash replyRouter,
                             long replyTunnel,
                             I2PAppContext ctx,
                             PublicKey peerKey)

  Place the asymmetrically encrypted record in the specified record slot, containing the hop's configuration (as well as the reply info, if it is an outbound endpoint)

### layeredEncrypt

    public void layeredEncrypt(I2PAppContext ctx,
                               TunnelBuildMessage msg,
                               TunnelCreatorConfig cfg,
                               java.util.List order)

  Encrypt the records so their hop ident is visible at the appropriate times

  Parameters:
    `order` - list of hop #s as Integers. For instance, if (order.get(1) is 4), it is peer cfg.getPeer(4)

### isBlank

    public static boolean isBlank(TunnelCreatorConfig cfg,
                                  int hop)