Class Blake2bX509AuthenticationSuite

    • Constructor Detail

      • Blake2bX509AuthenticationSuite

        public Blake2bX509AuthenticationSuite()
        Creates the suite.
    • Method Detail

      • getId

        public int getId()
        Gets the authentication suite ID.
        Specified by:
        getId in interface IAuthenticationSuite
        Returns:
        The authentication suite ID.
      • 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​(java.lang.String pid,
                                                                            java.lang.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​(java.lang.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​(java.math.BigInteger[] bigintarr)
        Converts a big integer array to a byte array.
        Parameters:
        bigintarr - Big integer array.
        Returns:
        Byte array.
      • byteArrayToBigIntegerArray

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