private int getBEREncodedAuthParamsPosition() { int length = getBERLength()- (authenticationParameters.getBERPayloadLength() + privacyParameters.getBERLength()); return length; }
private int getBEREncodedAuthParamsPosition() { int length = getBERLength()- (authenticationParameters.getBERPayloadLength() + privacyParameters.getBERLength()); return length; }
/** * getScopedPduPosition * * @return int */ public int getScopedPduPosition() { if (decodedLength >= 0) { return decodedLength + getSecurityParametersPosition(); } else { return getSecurityParametersPosition()+getBERLength(); } }
private int getBEREncodedAuthParamsPosition() { int length = getBERLength()- (authenticationParameters.getBERPayloadLength() + privacyParameters.getBERLength()); return length; }
/** * getScopedPduPosition * * @return int */ public int getScopedPduPosition() { if (decodedLength >= 0) { return decodedLength + getSecurityParametersPosition(); } else { return getSecurityParametersPosition()+getBERLength(); } }
/** * getScopedPduPosition * * @return int */ public int getScopedPduPosition() { if (decodedLength >= 0) { return decodedLength + getSecurityParametersPosition(); } else { return getSecurityParametersPosition()+getBERLength(); } }
private static byte[] buildWholeMessage(Integer32 snmpVersion, byte[] scopedPdu, byte[] globalData, UsmSecurityParameters usmSecurityParameters) throws IOException { int length = snmpVersion.getBERLength() + globalData.length + usmSecurityParameters.getBERLength() + scopedPdu.length; int totalLength = BER.getBERLengthOfLength(length) + length + 1; ByteArrayOutputStream os = new ByteArrayOutputStream(totalLength); BER.encodeHeader(os, BER.SEQUENCE, length); snmpVersion.encodeBER(os); os.write(globalData); usmSecurityParameters.encodeBER(os); os.write(scopedPdu); int secParamsPos = 1 + snmpVersion.getBERLength() + BER.getBERLengthOfLength(length) + globalData.length; usmSecurityParameters.setSecurityParametersPosition(secParamsPos); return os.toByteArray(); }