Package org.snmp4j.security.nonstandard
Class PrivAESWith3DESKeyExtension
java.lang.Object
org.snmp4j.security.PrivacyGeneric
org.snmp4j.security.PrivAES
org.snmp4j.security.nonstandard.PrivAESWith3DESKeyExtension
- All Implemented Interfaces:
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 for
Priv3DES
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:
-
Field Summary
Fields inherited from class org.snmp4j.security.PrivacyGeneric
cipherPool, initVectorLength, keyBytes, protocolClass, protocolId
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
extendShortKey
(byte[] shortKey, OctetString password, byte[] engineID, AuthenticationProtocol authProtocol) Extend a localized key that is too short.getID()
Gets the OID uniquely identifying the privacy protocol.void
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 Details
-
oid
-
-
Constructor Details
-
PrivAESWith3DESKeyExtension
public PrivAESWith3DESKeyExtension(int keyBytes) Constructor.- Parameters:
keyBytes
- Length of key, must be 16, 24 or 32.- Throws:
IllegalArgumentException
- if keyBytes is illegal
-
-
Method Details
-
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
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
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.
-