public final class EidasDigestUtil extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
hash(byte[] bytes)
Performs the given hash using the given
MessageDigest algorithm name and provider name (optional). |
static byte[] |
hash(byte[] bytes,
String algorithm,
String provider)
Performs the given hash using the given
MessageDigest algorithm name and provider name (optional). |
static byte[] |
hashPersonalToken(byte[] samlToken)
Hashes a SAML token.
|
static byte[] |
hashPersonalToken(byte[] samlToken,
String className)
Deprecated.
This implementation is bound to a concrete BouncyCastle implementation instead of using the standard
MessageDigest and the standardized algorithm names. Use hash(byte[], String,
String) instead. |
@Nonnull public static byte[] hash(@Nonnull byte[] bytes)
MessageDigest
algorithm name and provider name (optional).
The default algorithm "SHA-512"
is used.
The default JVM security providers are queried to perform the requested algorithm.
bytes
- the bytes to digest (hash)@Nonnull public static byte[] hash(@Nonnull byte[] bytes, @Nullable String algorithm, @Nullable String provider)
MessageDigest
algorithm name and provider name (optional).
If a null
algorithm name is provided, the default value "SHA-512"
is used.
If a null
provider name is given, the default JVM security providers are queried to perform the requested
algorithm.
bytes
- the bytes to digest (hash)algorithm
- the algorithm name e.g. "SHA-512"
. If null
, the default value "SHA-512"
is used.provider
- the provider name (can be null
).@Nonnull public static byte[] hashPersonalToken(@Nonnull byte[] samlToken)
samlToken
- the SAML Token to be hashed.@Nonnull @Deprecated public static byte[] hashPersonalToken(@Nonnull byte[] samlToken, String className)
MessageDigest
and the standardized algorithm names. Use hash(byte[], String,
String)
instead.samlToken
- the sam tokenclassName
- the class nameCopyright © 2020. All Rights Reserved.