@Override public Encoder getEncoder() { Encoder enc = getSignEncoder(); if (sender != null) enc.addToSequence(sender.getEncoder().setASN1Type(DD.TAG_AP1)); if (signature != null) enc.addToSequence(new Encoder(signature).setASN1Type(DD.TAG_AP2)); enc.setASN1Type(Encoder.CLASS_APPLICATION, Encoder.PC_CONSTRUCTED, getASN1Tag()); return enc; }
public Encoder getSignatureEncoder() { Encoder enc = new Encoder().initSequence(); // enc.addToSequence(new Encoder(introducerPeerGID)); enc.addToSequence(new Encoder(testerGID)); enc.addToSequence(new Encoder(weight)); enc.addToSequence(new Encoder(creation_date)); // enc.addToSequence(new Encoder(signature)); enc.setASN1Type(getASNType()); return enc; }
/** * sender has its own signature, so needs not be signed. Its PK has to match anyhow. * * @return */ public Encoder getSignEncoder() { Encoder enc = new Encoder().initSequence(); enc.addToSequence(new Encoder(version).setASN1Type(DD.TAG_AP0)); if (sk.size() > 0) enc.addToSequence(Encoder.getEncoder(sk).setASN1Type(DD.TAG_AC0)); if (peer.size() > 0) enc.addToSequence(Encoder.getEncoder(peer).setASN1Type(DD.TAG_AC1)); if (org.size() > 0) enc.addToSequence(Encoder.getEncoder(org).setASN1Type(DD.TAG_AC2)); if (neigh.size() > 0) enc.addToSequence(Encoder.getEncoder(neigh).setASN1Type(DD.TAG_AC3)); if (constit.size() > 0) enc.addToSequence(Encoder.getEncoder(constit).setASN1Type(DD.TAG_AC4)); if (witn.size() > 0) enc.addToSequence(Encoder.getEncoder(witn).setASN1Type(DD.TAG_AC5)); if (moti.size() > 0) enc.addToSequence(Encoder.getEncoder(moti).setASN1Type(DD.TAG_AC6)); if (just.size() > 0) enc.addToSequence(Encoder.getEncoder(just).setASN1Type(DD.TAG_AC7)); if (vote.size() > 0) enc.addToSequence(Encoder.getEncoder(vote).setASN1Type(DD.TAG_AC8)); if (news.size() > 0) enc.addToSequence(Encoder.getEncoder(news).setASN1Type(DD.TAG_AC9)); if (tran.size() > 0) enc.addToSequence(Encoder.getEncoder(tran).setASN1Type(DD.TAG_AC10)); return enc; }