- java.lang.Object
-
- org.snmp4j.security.PrivacyGeneric
-
- org.snmp4j.security.PrivAES
-
- org.snmp4j.security.nonstandard.PrivAESWith3DESKeyExtension
-
- All Implemented Interfaces:
java.io.Serializable
,NonStandardSecurityProtocol
,PrivacyProtocol
,SecurityProtocol
- Direct Known Subclasses:
PrivAES192With3DESKeyExtension
,PrivAES256With3DESKeyExtension
public abstract class PrivAESWith3DESKeyExtension extends PrivAES implements NonStandardSecurityProtocol
This class is provided for interoperability with some broken AES implementations of major network device manufactures which use a key extension algorithm that was specified forPriv3DES
but was never specified for AES 192 and 256 bit.Note: DO NOT USE THIS CLASS IF YOU WANT TO COMPLY WITH draft-blumenthal-aes-usm-04.txt!
- Since:
- 2.2.3
- Version:
- 2.2.3
- Author:
- Frank Fock
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected OID
oid
-
Fields inherited from class org.snmp4j.security.PrivacyGeneric
cipherPool, initVectorLength, keyBytes, protocolClass, protocolId
-
-
Constructor Summary
Constructors Constructor Description PrivAESWith3DESKeyExtension(int keyBytes)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
extendShortKey(byte[] shortKey, OctetString password, byte[] engineID, AuthenticationProtocol authProtocol)
Extend a localized key that is too short.OID
getID()
Gets the OID uniquely identifying the privacy protocol.void
setID(OID newOID)
Assign a new ID to a non-standard security protocol instance.-
Methods inherited from class org.snmp4j.security.PrivAES
asHex, decrypt, encrypt, getDecryptParamsLength, getEncryptedLength, getMaxKeyLength, getMinKeyLength
-
Methods inherited from class org.snmp4j.security.PrivacyGeneric
doDecrypt, doFinal, doFinalWithPadding, doInit, isSupported
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.snmp4j.security.nonstandard.NonStandardSecurityProtocol
getDefaultID
-
Methods inherited from interface org.snmp4j.security.SecurityProtocol
isSupported
-
-
-
-
Field Detail
-
oid
protected OID oid
-
-
Method Detail
-
extendShortKey
public byte[] extendShortKey(byte[] shortKey, OctetString password, byte[] engineID, AuthenticationProtocol authProtocol)
Description copied from interface:PrivacyProtocol
Extend a localized key that is too short. Some privacy protocols require a key that is longer than the key generated by the password-to-key algorithm of the authentication protocol. This function extends a short key to the required length.- Specified by:
extendShortKey
in interfacePrivacyProtocol
- Overrides:
extendShortKey
in classPrivAES
- Parameters:
shortKey
- the short key that was generated usingAuthenticationProtocol.passwordToKey(org.snmp4j.smi.OctetString, byte[])
function.password
- the password to use for key extension.engineID
- the SNMP engine ID of the authoritative engine.authProtocol
- the authentication protocol that should be used.- Returns:
- the extended key or
shortKey
if no extension is needed.
-
setID
public void setID(OID newOID)
Description copied from interface:NonStandardSecurityProtocol
Assign a new ID to a non-standard security protocol instance.- Specified by:
setID
in interfaceNonStandardSecurityProtocol
- Parameters:
newOID
- the new security protcol ID for the security protocol class called.
-
getID
public OID getID()
Description copied from interface:PrivacyProtocol
Gets the OID uniquely identifying the privacy protocol.- Specified by:
getID
in interfacePrivacyProtocol
- Specified by:
getID
in interfaceSecurityProtocol
- Returns:
- an
OID
instance.
-
-