Class SealedBoxUtility

    • Field Detail

    • Constructor Detail

      • SealedBoxUtility

        public SealedBoxUtility()
    • Method Detail

      • cryptoBoxSeal

        public static byte[] cryptoBoxSeal​(byte[] receiverPubKey,
                                           byte[] clearText)
                                    throws GeneralSecurityException
        Encrypt in a sealed box
        Parameters:
        receiverPubKey - receiver public key
        clearText - clear text
        Returns:
        encrypted message
        Throws:
        GeneralSecurityException
      • cryptoBoxSealNonce

        public static byte[] cryptoBoxSealNonce​(byte[] senderpk,
                                                byte[] mypk)
        hash the combination of senderpk + mypk into nonce using blake2b hash
        Parameters:
        senderpk - the senders public key
        mypk - my own public key
        Returns:
        the nonce computed using Blake2b generic hash