Module org.snmp4j

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 Details

    • oid

      protected OID 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 interface PrivacyProtocol
      Overrides:
      extendShortKey in class PrivAES
      Parameters:
      shortKey - the short key that was generated using AuthenticationProtocol.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 interface NonStandardSecurityProtocol
      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 interface PrivacyProtocol
      Specified by:
      getID in interface SecurityProtocol
      Returns:
      an OID instance.