public class HmacHelp extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
HmacHelp(String algorithm,
byte[] key) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
check(@Nullable String sum,
byte[] bytes) |
boolean |
check(@Nullable String sum,
@Nullable InputStream ins) |
boolean |
check(@Nullable String sum,
@Nullable String str) |
byte[] |
digest(byte[] bytes) |
static @NotNull HmacHelp |
md5(byte[] key) |
static @NotNull Mac |
newMd5(byte[] key) |
@NotNull Mac |
newOne()
create a Mac instance, the instance it not thread-safe
|
static @NotNull Mac |
newOne(@NotNull String algorithm,
byte[] key) |
static @NotNull Mac |
newSha1(byte[] key) |
static @NotNull Mac |
newSha256(byte[] key) |
static @NotNull HmacHelp |
of(@NotNull String algorithm,
byte[] key) |
static @NotNull HmacHelp |
sha1(byte[] key) |
static @NotNull HmacHelp |
sha256(byte[] key) |
@NotNull String |
sum(byte[] bytes) |
@NotNull String |
sum(byte[] bytes,
boolean upper) |
@NotNull String |
sum(@Nullable InputStream ins) |
@NotNull String |
sum(@Nullable InputStream ins,
boolean upper) |
@NotNull String |
sum(@Nullable String str) |
@NotNull String |
sum(@Nullable String str,
boolean upper) |
public final String algorithm
public final byte[] key
protected HmacHelp(String algorithm, byte[] key)
@NotNull public @NotNull String sum(@Nullable @Nullable InputStream ins)
@NotNull public @NotNull String sum(byte[] bytes)
@NotNull public @NotNull String sum(@Nullable @Nullable InputStream ins, boolean upper)
@NotNull public @NotNull String sum(byte[] bytes, boolean upper)
public byte[] digest(byte[] bytes)
@NotNull public @NotNull Mac newOne()
public boolean check(@Nullable
@Nullable String sum,
byte[] bytes)
public boolean check(@Nullable
@Nullable String sum,
@Nullable
@Nullable InputStream ins)
@NotNull public static @NotNull HmacHelp md5(byte[] key)
@NotNull public static @NotNull HmacHelp sha1(byte[] key)
@NotNull public static @NotNull HmacHelp sha256(byte[] key)
@NotNull public static @NotNull Mac newMd5(byte[] key)
@NotNull public static @NotNull Mac newSha1(byte[] key)
@NotNull public static @NotNull Mac newSha256(byte[] key)
Copyright © 2023. All rights reserved.