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
FieldsFields inherited from class org.snmp4j.security.PrivacyGeneric
cipherPool, initVectorLength, keyBytes, protocolClass, protocolId -
Constructor Summary
Constructors -
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.voidAssign a new ID to a non-standard security protocol instance.Methods inherited from class org.snmp4j.security.PrivAES
asHex, decrypt, encrypt, getDecryptParamsLength, getEncryptedLength, getMaxKeyLength, getMinKeyLengthMethods inherited from class org.snmp4j.security.PrivacyGeneric
doDecrypt, doFinal, doFinalWithPadding, doInit, isSupportedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.snmp4j.security.nonstandard.NonStandardSecurityProtocol
getDefaultIDMethods 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:PrivacyProtocolExtend 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:
extendShortKeyin interfacePrivacyProtocol- Overrides:
extendShortKeyin 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
shortKeyif no extension is needed.
-
setID
Description copied from interface:NonStandardSecurityProtocolAssign a new ID to a non-standard security protocol instance.- Specified by:
setIDin interfaceNonStandardSecurityProtocol- Parameters:
newOID- the new security protcol ID for the security protocol class called.
-
getID
Description copied from interface:PrivacyProtocolGets the OID uniquely identifying the privacy protocol.- Specified by:
getIDin interfacePrivacyProtocol- Specified by:
getIDin interfaceSecurityProtocol- Returns:
- an
OIDinstance.
-