public void setEncodingContent(BerOutputStream out) { type.setEncodingContent(out); } }
public DerOutputStream(ASN1Type asn1, Object object) { content = object; index = -1; asn1.setEncodingContent(this); encoded = new byte[asn1.getEncodedLength(this)]; index = 0; asn1.encodeASN(this); }
@Override public void getExplicitLength(ASN1Explicit explicit) { Object[] values = new Object[1]; int[] compLens = new int[1]; values[0] = content; push(compLens, values); explicit.type.setEncodingContent(this); // in case if we get content bytes while getting its length // FIXME what about remove it: need redesign values[0] = content; compLens[0] = length; length = explicit.type.getEncodedLength(this); }
@Override public void getChoiceLength(ASN1Choice choice) { int i = choice.getIndex(content); content = choice.getObjectToEncode(content); Object[] values = new Object[] { choice.type[i], content }; push(null, values); choice.type[i].setEncodingContent(this); // in case if we get content bytes while getting its length // FIXME what about remove it: need redesign values[1] = content; }
private void getValueOfLength(ASN1ValueCollection collection) { //FIXME what about another way? Object[] cv = collection.getValues(content).toArray(); Object[] values = new Object[cv.length]; int[] compLens = new int[values.length]; push(compLens, values); int seqLen = 0; for (int i = 0; i < values.length; i++) { content = cv[i]; collection.type.setEncodingContent(this); compLens[i] = length; // in case if we get content bytes while getting its length // FIXME what about remove it: need redesign values[i] = content; seqLen += collection.type.getEncodedLength(this); } length = seqLen; } }
@Override public void getSequenceLength(ASN1Sequence sequence) { ASN1Type[] type = sequence.type; Object[] values = new Object[type.length]; int[] compLens = new int[type.length]; sequence.getValues(content, values); push(compLens, values); int seqLen = 0; for (int i = 0; i < type.length; i++) { // check optional types if (values[i] == null) { if (sequence.OPTIONAL[i]) { continue; } else { throw new RuntimeException();//FIXME type & message } } if (Objects.equal(sequence.DEFAULT[i], values[i])) { values[i] = null; continue; } content = values[i]; type[i].setEncodingContent(this); compLens[i] = length; // in case if we get content bytes while getting its length // FIXME what about remove it: need redesign values[i] = content; seqLen += type[i].getEncodedLength(this); } length = seqLen; }
@Override public void getExplicitLength(ASN1Explicit explicit) { Object[] values = new Object[1]; int[] compLens = new int[1]; values[0] = content; push(compLens, values); explicit.type.setEncodingContent(this); // in case if we get content bytes while getting its length // FIXME what about remove it: need redesign values[0] = content; compLens[0] = length; length = explicit.type.getEncodedLength(this); }
@Override public void getExplicitLength(ASN1Explicit explicit) { Object[] values = new Object[1]; int[] compLens = new int[1]; values[0] = content; push(compLens, values); explicit.type.setEncodingContent(this); // in case if we get content bytes while getting its length // FIXME what about remove it: need redesign values[0] = content; compLens[0] = length; length = explicit.type.getEncodedLength(this); }
@Override public void getExplicitLength(ASN1Explicit explicit) { Object[] values = new Object[1]; int[] compLens = new int[1]; values[0] = content; push(compLens, values); explicit.type.setEncodingContent(this); // in case if we get content bytes while getting its length // FIXME what about remove it: need redesign values[0] = content; compLens[0] = length; length = explicit.type.getEncodedLength(this); }
public DerOutputStream(ASN1Type asn1, Object object) { content = object; index = -1; asn1.setEncodingContent(this); encoded = new byte[asn1.getEncodedLength(this)]; index = 0; asn1.encodeASN(this); }
public DerOutputStream(ASN1Type asn1, Object object) { content = object; index = -1; asn1.setEncodingContent(this); encoded = new byte[asn1.getEncodedLength(this)]; index = 0; asn1.encodeASN(this); }
public DerOutputStream(ASN1Type asn1, Object object) { content = object; index = -1; asn1.setEncodingContent(this); encoded = new byte[asn1.getEncodedLength(this)]; index = 0; asn1.encodeASN(this); }
@Override public void getExplicitLength(ASN1Explicit explicit) { Object[] values = new Object[1]; int[] compLens = new int[1]; values[0] = content; push(compLens, values); explicit.type.setEncodingContent(this); // in case if we get content bytes while getting its length // FIXME what about remove it: need redesign values[0] = content; compLens[0] = length; length = explicit.type.getEncodedLength(this); }
@Override public void getExplicitLength(ASN1Explicit explicit) { Object[] values = new Object[1]; int[] compLens = new int[1]; values[0] = content; push(compLens, values); explicit.type.setEncodingContent(this); // in case if we get content bytes while getting its length // FIXME what about remove it: need redesign values[0] = content; compLens[0] = length; length = explicit.type.getEncodedLength(this); }
@Override public void getChoiceLength(ASN1Choice choice) { int i = choice.getIndex(content); content = choice.getObjectToEncode(content); Object[] values = new Object[] { choice.type[i], content }; push(null, values); choice.type[i].setEncodingContent(this); // in case if we get content bytes while getting its length // FIXME what about remove it: need redesign values[1] = content; }
@Override public void getChoiceLength(ASN1Choice choice) { int i = choice.getIndex(content); content = choice.getObjectToEncode(content); Object[] values = new Object[] { choice.type[i], content }; push(null, values); choice.type[i].setEncodingContent(this); // in case if we get content bytes while getting its length // FIXME what about remove it: need redesign values[1] = content; }
@Override public void getChoiceLength(ASN1Choice choice) { int i = choice.getIndex(content); content = choice.getObjectToEncode(content); Object[] values = new Object[] { choice.type[i], content }; push(null, values); choice.type[i].setEncodingContent(this); // in case if we get content bytes while getting its length // FIXME what about remove it: need redesign values[1] = content; }
@Override public void getChoiceLength(ASN1Choice choice) { int i = choice.getIndex(content); content = choice.getObjectToEncode(content); Object[] values = new Object[] { choice.type[i], content }; push(null, values); choice.type[i].setEncodingContent(this); // in case if we get content bytes while getting its length // FIXME what about remove it: need redesign values[1] = content; }
@Override public void getChoiceLength(ASN1Choice choice) { int i = choice.getIndex(content); content = choice.getObjectToEncode(content); Object[] values = new Object[] { choice.type[i], content }; push(null, values); choice.type[i].setEncodingContent(this); // in case if we get content bytes while getting its length // FIXME what about remove it: need redesign values[1] = content; }
@Override public void getChoiceLength(ASN1Choice choice) { int i = choice.getIndex(content); content = choice.getObjectToEncode(content); Object[] values = new Object[] { choice.type[i], content }; push(null, values); choice.type[i].setEncodingContent(this); // in case if we get content bytes while getting its length // FIXME what about remove it: need redesign values[1] = content; }