Class Blake3X509AuthenticationSuite

java.lang.Object
jadex.ipc.impl.security.authentication.Blake3X509AuthenticationSuite
All Implemented Interfaces:
IAuthenticationSuite

public class Blake3X509AuthenticationSuite extends Object implements IAuthenticationSuite
Symmetric authentication based on Blake2b MACs.
  • Field Details

  • Constructor Details

    • Blake3X509AuthenticationSuite

      public Blake3X509AuthenticationSuite()
      Creates the suite.
  • Method Details

    • getId

      public int getId()
      Gets the authentication suite ID.
      Specified by:
      getId in interface IAuthenticationSuite
      Returns:
      The authentication suite ID.
    • getPakeRound1

      public byte[] getPakeRound1(Security security, jadex.core.ComponentIdentifier remoteid)
      Gets the first round of the password-authenticated key-exchange.
      Specified by:
      getPakeRound1 in interface IAuthenticationSuite
      Returns:
      First round payload.
    • getPakeRound2

      public byte[] getPakeRound2(Security security, jadex.core.ComponentIdentifier remoteid, byte[] round1data)
      Gets the second round of the password-authenticated key-exchange.
      Specified by:
      getPakeRound2 in interface IAuthenticationSuite
      Returns:
      Second round payload.
    • finalizePake

      public void finalizePake(Security security, jadex.core.ComponentIdentifier remoteid, byte[] round2data)
      Finalizes the password-authenticated key exchange.
      Specified by:
      finalizePake in interface IAuthenticationSuite
    • createAuthenticationToken

      public AuthToken createAuthenticationToken(byte[] msg, AbstractAuthenticationSecret secret)
      Creates an authentication token for a message based on an abstract implementation-dependent "key".
      Specified by:
      createAuthenticationToken in interface IAuthenticationSuite
      Parameters:
      msg - The message being authenticated.
      secret - The secret used for authentication.
      Returns:
      Authentication token.
    • verifyAuthenticationToken

      public boolean verifyAuthenticationToken(byte[] msg, AbstractAuthenticationSecret secret, AuthToken authtoken)
      Creates an authentication token for a message based on an abstract implementation-dependent "key".
      Specified by:
      verifyAuthenticationToken in interface IAuthenticationSuite
      Parameters:
      msg - The message being authenticated.
      secret - The secret used for authentication.
      authtoken - Authentication token.
      Returns:
      True if authenticated, false otherwise.
    • getMessageHash

      protected static final byte[] getMessageHash(byte[] msg, byte[] salt)
      Create message hash.
      Parameters:
      msg - The message.
      Returns:
      Hashed message.
    • createJPakeParticipant

      protected static final JadexJPakeParticipant createJPakeParticipant(String pid, String password)
      Creates a new participant for JPAKE.
      Parameters:
      pid -
      Returns:
    • round1ToBytes

      protected static final byte[] round1ToBytes(org.bouncycastle.crypto.agreement.jpake.JPAKERound1Payload r1pl)
      Encodes JPAKE round 1.
      Parameters:
      r1pl - JPAKE round 1.
      Returns:
      Encoded round.
    • bytesToRound1

      protected static final org.bouncycastle.crypto.agreement.jpake.JPAKERound1Payload bytesToRound1(byte[] bytes)
      Decodes JPAKE round 1.
      Parameters:
      bytes - Encoded round.
      Returns:
      JPAKE round 1.
    • round2ToBytes

      protected static final byte[] round2ToBytes(org.bouncycastle.crypto.agreement.jpake.JPAKERound2Payload r2pl)
      Encodes JPAKE round 2.
      Parameters:
      r1pl - JPAKE round 2.
      Returns:
      Encoded round.
    • bytesToRound2

      protected static final org.bouncycastle.crypto.agreement.jpake.JPAKERound2Payload bytesToRound2(byte[] bytes)
      Decodes JPAKE round 2.
      Parameters:
      bytes - Encoded round.
      Returns:
      JPAKE round 2.
    • createSaltedId

      protected byte[] createSaltedId(String id, byte[] idsalt)
      Hashes an id with a salt.
      Parameters:
      id - The clear id.
      idsalt - The salt.
      Returns:
      Salted ID.
    • bigIntegerArrayToByteArray

      protected static final byte[] bigIntegerArrayToByteArray(BigInteger[] bigintarr)
      Converts a big integer array to a byte array.
      Parameters:
      bigintarr - Big integer array.
      Returns:
      Byte array.
    • byteArrayToBigIntegerArray

      protected static final BigInteger[] byteArrayToBigIntegerArray(byte[] bytes)
      Converts a byte array back into a big integer array.
      Parameters:
      bytes - The byte array.
      Returns:
      The big integer array