public class UsmSecurityParameters extends java.lang.Object implements SecurityParameters
Modifier and Type | Field and Description |
---|---|
private byte[] |
authenticationKey |
private OctetString |
authenticationParameters |
private AuthenticationProtocol |
authenticationProtocol |
private Integer32 |
authoritativeEngineBoots |
private OctetString |
authoritativeEngineID |
private Integer32 |
authoritativeEngineTime |
private int |
authParametersPosition |
private int |
decodedLength |
private static LogAdapter |
logger |
private static int |
MAX_BER_LENGTH_WITHOU_SEC_PARAMS |
private byte[] |
privacyKey |
private OctetString |
privacyParameters |
private PrivacyProtocol |
privacyProtocol |
private int |
securityParametersPosition |
private int |
sequencePosition |
private OctetString |
userName |
Constructor and Description |
---|
UsmSecurityParameters() |
UsmSecurityParameters(OctetString authoritativeEngineID,
Integer32 authoritativeEngineBoots,
Integer32 authoritativeEngineTime,
OctetString userName,
AuthenticationProtocol authenticationProtocol,
PrivacyProtocol privacyProtocol) |
Modifier and Type | Method and Description |
---|---|
void |
decodeBER(BERInputStream inputStream)
Decodes a
Variable from an InputStream . |
void |
encodeBER(java.io.OutputStream outputStream)
Encodes a
Variable to an OutputStream . |
byte[] |
getAuthenticationKey() |
OctetString |
getAuthenticationParameters() |
AuthenticationProtocol |
getAuthenticationProtocol() |
int |
getAuthoritativeEngineBoots() |
byte[] |
getAuthoritativeEngineID() |
int |
getAuthoritativeEngineTime() |
int |
getAuthParametersPosition() |
private int |
getBEREncodedAuthParamsPosition() |
int |
getBERLength()
Returns the length of this
BERSerializable object
in bytes when encoded according to the Basic Encoding Rules (BER). |
int |
getBERMaxLength(int securityLevel)
Gets the maximum length of the BER encoded representation of this
SecurityParameters instance. |
int |
getBERPayloadLength()
Returns the length of the payload of this
BERSerializable object
in bytes when encoded according to the Basic Encoding Rules (BER). |
int |
getBERUsmPayloadLength()
getBERUsmPayloadLength
|
byte[] |
getPrivacyKey() |
OctetString |
getPrivacyParameters() |
PrivacyProtocol |
getPrivacyProtocol() |
int |
getScopedPduPosition()
getScopedPduPosition
|
int |
getSecurityParametersPosition()
Gets the byte position of the first byte (counted from zero) of the
security parameters in the whole message.
|
int |
getSequencePosition() |
OctetString |
getUserName() |
void |
setAuthenticationKey(byte[] authenticationKey) |
void |
setAuthenticationParameters(OctetString authenticationParameters) |
void |
setAuthenticationProtocol(AuthenticationProtocol authenticationProtocol) |
void |
setAuthoritativeEngineBoots(int authoritativeEngineBoots) |
void |
setAuthoritativeEngineID(byte[] authoritativeEngineID) |
void |
setAuthoritativeEngineTime(int authoritativeEngineTime) |
void |
setPrivacyKey(byte[] privacyKey) |
void |
setPrivacyParameters(OctetString privacyParameters) |
void |
setPrivacyProtocol(PrivacyProtocol privacyProtocol) |
void |
setSecurityParametersPosition(int securityParametersPosition)
Sets the position of the first byte (counted from zero) of the security
parameters in the whole SNMP message.
|
void |
setUserName(OctetString userName) |
private static final LogAdapter logger
private static final int MAX_BER_LENGTH_WITHOU_SEC_PARAMS
private OctetString authoritativeEngineID
private Integer32 authoritativeEngineBoots
private Integer32 authoritativeEngineTime
private OctetString userName
private AuthenticationProtocol authenticationProtocol
private PrivacyProtocol privacyProtocol
private byte[] authenticationKey
private byte[] privacyKey
private OctetString privacyParameters
private OctetString authenticationParameters
private int securityParametersPosition
private int authParametersPosition
private int decodedLength
private int sequencePosition
public UsmSecurityParameters()
public UsmSecurityParameters(OctetString authoritativeEngineID, Integer32 authoritativeEngineBoots, Integer32 authoritativeEngineTime, OctetString userName, AuthenticationProtocol authenticationProtocol, PrivacyProtocol privacyProtocol)
public byte[] getAuthoritativeEngineID()
public void setAuthoritativeEngineID(byte[] authoritativeEngineID)
public void setAuthoritativeEngineBoots(int authoritativeEngineBoots)
public int getAuthoritativeEngineBoots()
public void setAuthoritativeEngineTime(int authoritativeEngineTime)
public int getAuthoritativeEngineTime()
public void setUserName(OctetString userName)
public OctetString getUserName()
public void setAuthenticationProtocol(AuthenticationProtocol authenticationProtocol)
public AuthenticationProtocol getAuthenticationProtocol()
public void setPrivacyProtocol(PrivacyProtocol privacyProtocol)
public PrivacyProtocol getPrivacyProtocol()
public int getBERLength()
BERSerializable
BERSerializable
object
in bytes when encoded according to the Basic Encoding Rules (BER).getBERLength
in interface BERSerializable
public int getBERPayloadLength()
BERSerializable
BERSerializable
object
in bytes when encoded according to the Basic Encoding Rules (BER).getBERPayloadLength
in interface BERSerializable
public void decodeBER(BERInputStream inputStream) throws java.io.IOException
BERSerializable
Variable
from an InputStream
.decodeBER
in interface BERSerializable
inputStream
- an InputStream
containing a BER encoded byte stream.java.io.IOException
- if the stream could not be decoded by using BER rules.private int getBEREncodedAuthParamsPosition()
public int getSequencePosition()
public void encodeBER(java.io.OutputStream outputStream) throws java.io.IOException
BERSerializable
Variable
to an OutputStream
.encodeBER
in interface BERSerializable
outputStream
- an OutputStream
.java.io.IOException
- if an error occurs while writing to the stream.public int getBERUsmPayloadLength()
public int getBERMaxLength(int securityLevel)
SecurityParameters
SecurityParameters
instance.getBERMaxLength
in interface SecurityParameters
securityLevel
- the security level to be used.public byte[] getAuthenticationKey()
public void setAuthenticationKey(byte[] authenticationKey)
public byte[] getPrivacyKey()
public void setPrivacyKey(byte[] privacyKey)
public OctetString getPrivacyParameters()
public void setPrivacyParameters(OctetString privacyParameters)
public OctetString getAuthenticationParameters()
public void setAuthenticationParameters(OctetString authenticationParameters)
public int getSecurityParametersPosition()
SecurityParameters
getSecurityParametersPosition
in interface SecurityParameters
public void setSecurityParametersPosition(int securityParametersPosition)
SecurityParameters
setSecurityParametersPosition
in interface SecurityParameters
securityParametersPosition
- an integer value >= 0.public int getAuthParametersPosition()
public int getScopedPduPosition()