1 /*_############################################################################ 2 _## 3 _## SNMP4J - SecurityParameters.java 4 _## 5 _## Copyright 2003-2007 Frank Fock and Jochen Katz (SNMP4J.org) 6 _## 7 _## Licensed under the Apache License, Version 2.0 (the "License"); 8 _## you may not use this file except in compliance with the License. 9 _## You may obtain a copy of the License at 10 _## 11 _## http://www.apache.org/licenses/LICENSE-2.0 12 _## 13 _## Unless required by applicable law or agreed to in writing, software 14 _## distributed under the License is distributed on an "AS IS" BASIS, 15 _## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 _## See the License for the specific language governing permissions and 17 _## limitations under the License. 18 _## 19 _##########################################################################*/ 20 21 22 23 24 25 package org.snmp4j.security; 26 27 import org.snmp4j.asn1.BERSerializable; 28 29 /** 30 * The <code>SecurityParameters</code> interface represents the security 31 * parameters in a SNMPv3 message. 32 * 33 * @author Frank Fock 34 * @version 1.0 35 */ 36 public interface SecurityParameters extends BERSerializable { 37 38 /** 39 * Gets the byte position of the first byte (counted from zero) of the 40 * security parameters in the whole message. 41 * @return 42 * the position of the first byte (counted from zero) of the security 43 * parameters in the whole SNMP message. -1 is returned, when the position 44 * is unknown (not set). 45 */ 46 int getSecurityParametersPosition(); 47 48 /** 49 * Sets the position of the first byte (counted from zero) of the security 50 * parameters in the whole SNMP message. 51 * @param pos 52 * an integer value >= 0. 53 */ 54 void setSecurityParametersPosition(int pos); 55 56 /** 57 * Gets the maximum length of the BER encoded representation of this 58 * <code>SecurityParameters</code> instance. 59 * @param securityLevel 60 * the security level to be used. 61 * @return 62 * the maximum BER encoded length in bytes. 63 */ 64 int getBERMaxLength(int securityLevel); 65 } 66