Mac hashers
| Modifier and Type | Class and Description |
|---|---|
| public static class | HkdfMacFactory.
Default implementation |
| Modifier and Type | Method and Description |
|---|---|
| public Mac | Returns: a new mac instancethe key used, must not be null key)Creates a new instance of Hmac with given key, i.e. it must already be initialized
with |
| public SecretKey | Returns: wrapped as secret key instance or null if input is null or emptythe raw key rawKeyMaterial)Creates a secret key from a byte raw key material to be used with |
| public int | Returns: the length of mac output in bytesGet the length of the mac output in bytes |
| createInstance | back to summary |
|---|---|
| public Mac createInstance(SecretKey key) Creates a new instance of Hmac with given key, i.e. it must already be initialized
with | |
| createSecretKey | back to summary |
|---|---|
| public SecretKey createSecretKey(byte[] rawKeyMaterial) Creates a secret key from a byte raw key material to be used with
| |
| getMacLengthBytes | back to summary |
|---|---|
| public int getMacLengthBytes() Get the length of the mac output in bytes
| |
| Access | Constructor and Description |
|---|---|
| public | |
| public | Default(String
as used by macAlgorithmName, Provider Mac#getInstance(String)the security provider, see provider)Mac#getInstance(String, Provider); may be null to use defaultCreates a mac factory |
| Modifier and Type | Method and Description |
|---|---|
| public Mac | createInstance(SecretKey
the key used, must not be null key)Implements at. Creates a new instance of Hmac with given key, i.e. it must already be initialized
with |
| private Mac | |
| public SecretKey | createSecretKey(byte[]
the raw key rawKeyMaterial)Implements at. Creates a secret key from a byte raw key material to be used with |
| public int | getMacLengthBytes()
Implements at. Get the length of the mac output in bytes |
| public static HkdfMacFactory | Returns: factory
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 |
| public static HkdfMacFactory | |
| public static HkdfMacFactory |
| macAlgorithmName | back to summary |
|---|---|
| private final String macAlgorithmName | |
| provider | back to summary |
|---|---|
| private final Provider provider | |
| Default | back to summary |
|---|---|
| public Default(String macAlgorithmName) Creates a mac factory
| |
| Default | back to summary |
|---|---|
| public Default(String macAlgorithmName, Provider provider) Creates a mac factory
| |
| createInstance | back to summary |
|---|---|
| public Mac createInstance(SecretKey key) Implements at. Doc from at. Creates a new instance of Hmac with given key, i.e. it must already be initialized
with | |
| createMacInstance | back to summary |
|---|---|
| private Mac createMacInstance() | |
| createSecretKey | back to summary |
|---|---|
| public SecretKey createSecretKey(byte[] rawKeyMaterial) Implements at. Doc from at. Creates a secret key from a byte raw key material to be used with | |
| getMacLengthBytes | back to summary |
|---|---|
| public int getMacLengthBytes() Implements at. Doc from at. Get the length of the mac output in bytes
| |
| hmacSha1 | back to summary |
|---|---|
| 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
| |
| hmacSha256 | back to summary |
|---|---|
| public static HkdfMacFactory hmacSha256() Creates a factory creating HMAC with SHA-256
| |
| hmacSha512 | back to summary |
|---|---|
| public static HkdfMacFactory hmacSha512() Creates a factory creating HMAC with SHA-512
| |