Class ConfidentialityAlgorithm

java.lang.Object
org.sentrysoftware.ipmi.core.coding.security.ConfidentialityAlgorithm
Direct Known Subclasses:
ConfidentialityAesCbc128, ConfidentialityNone

public abstract class ConfidentialityAlgorithm extends Object
Interface for Confidentiality Algorithms. All classes extending this one must implement constructor(byte[]).
  • Constructor Details

    • ConfidentialityAlgorithm

      public ConfidentialityAlgorithm()
  • Method Details

    • initialize

      public void initialize(byte[] sik) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException
      Initializes Confidentiality Algorithm
      Parameters:
      sik - - Session Integrity Key calculated during the opening of the session or user password if 'one-key' logins are enabled.
      Throws:
      InvalidKeyException - - when initiation of the algorithm fails
      NoSuchAlgorithmException - - when initiation of the algorithm fails
      NoSuchPaddingException - - when initiation of the algorithm fails
    • getCode

      public abstract byte getCode()
      Returns the algorithm's ID.
    • encrypt

      public abstract byte[] encrypt(byte[] data) throws InvalidKeyException
      Encrypts the data.
      Parameters:
      data - - payload to be encrypted
      Returns:
      encrypted data encapsulated in COnfidentiality Header and Trailer.
      Throws:
      InvalidKeyException - - when initiation of the algorithm fails
    • decrypt

      public abstract byte[] decrypt(byte[] data)
      Decrypts the data.
      Parameters:
      data - - encrypted data encapsulated in COnfidentiality Header and Trailer.
      Returns:
      decrypted data.
      Throws:
      IllegalArgumentException - - when initiation of the algorithm fails
    • getConfidentialityOverheadSize

      public abstract int getConfidentialityOverheadSize(int payloadSize)
      Calculates size of the confidentiality header and trailer specific for the algorithm.
      Parameters:
      payloadSize - - size of the data that will be encrypted