public DEROtherInfo generate(byte[] suppPrivInfoPartB) { if (used) { throw new IllegalStateException("builder already used"); } used = true; this.otherInfoBuilder.withSuppPrivInfo(agreement.calculateAgreement(NHOtherInfoGenerator.getPublicKey(suppPrivInfoPartB))); return otherInfoBuilder.build(); } }
public byte[] getSuppPrivInfoPartB(byte[] suppPrivInfoPartA) { NHExchangePairGenerator exchGen = new NHExchangePairGenerator(random); ExchangePair bEp = exchGen.generateExchange(getPublicKey(suppPrivInfoPartA)); this.otherInfoBuilder.withSuppPrivInfo(bEp.getSharedValue()); return getEncoded((NHPublicKeyParameters)bEp.getPublicKey()); }