Class MacDigestManager


  • public class MacDigestManager
    extends DigestManager
    A SHA-1 based digest manager.

    NOTE: This class is tended to be used by this project only. External users should not rely on it directly.

    • Field Detail

      • DIGEST_ALGORITHM

        public static final java.lang.String DIGEST_ALGORITHM
        See Also:
        Constant Field Values
      • passwd

        final byte[] passwd
      • EMPTY_LEDGER_KEY

        static final byte[] EMPTY_LEDGER_KEY
    • Constructor Detail

      • MacDigestManager

        public MacDigestManager​(long ledgerId,
                                byte[] passwd,
                                boolean useV2Protocol,
                                io.netty.buffer.ByteBufAllocator allocator)
                         throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
    • Method Detail

      • genDigest

        public static byte[] genDigest​(java.lang.String pad,
                                       byte[] passwd)
                                throws java.security.NoSuchAlgorithmException
        Throws:
        java.security.NoSuchAlgorithmException
      • internalUpdate

        int internalUpdate​(int digest,
                           io.netty.buffer.ByteBuf data,
                           int offset,
                           int len)
        Specified by:
        internalUpdate in class DigestManager
      • internalUpdate

        int internalUpdate​(int digest,
                           byte[] buffer,
                           int offset,
                           int len)
        Specified by:
        internalUpdate in class DigestManager