Class HkdfMacFactory.Default

    • Method Detail

      • hmacSha256

        public static HkdfMacFactory hmacSha256()
        Creates a factory creating HMAC with SHA-256
        Returns:
        factory
      • hmacSha512

        public static HkdfMacFactory hmacSha512()
        Creates a factory creating HMAC with SHA-512
        Returns:
        factory
      • hmacSha1

        @Deprecated
        public static HkdfMacFactory hmacSha1()
        Deprecated.
        sha1 with HMAC should be fine, but not recommended for new protocols; see https://crypto.stackexchange.com/questions/26510/why-is-hmac-sha1-still-considered-secure
        Creates a factory creating HMAC with SHA-1
        Returns:
        factory
      • createInstance

        public Mac createInstance​(SecretKey key)
        Description copied from interface: HkdfMacFactory
        Creates a new instance of Hmac with given key, i.e. it must already be initialized with Mac.init(Key).
        Specified by:
        createInstance in interface HkdfMacFactory
        Parameters:
        key - the key used, must not be null
        Returns:
        a new mac instance
      • getMacLengthBytes

        public int getMacLengthBytes()
        Description copied from interface: HkdfMacFactory
        Get the length of the mac output in bytes
        Specified by:
        getMacLengthBytes in interface HkdfMacFactory
        Returns:
        the length of mac output in bytes