java.lang.Object
io.helidon.security.spi.DigestProvider.DigestSupport
- Enclosing interface:
DigestProvider<T extends ProviderConfig>
Digest support created for each named digest configuration, used by
Security
for Security.digest(String, byte[])
and Security.verifyDigest(String, byte[], String)
methods.-
Constructor Summary
ModifierConstructorDescriptionprotected
DigestSupport
(DigestProvider.DigestFunction digestFunction, DigestProvider.VerifyFunction verifyFunction) Digest support based on the two functions. -
Method Summary
Modifier and TypeMethodDescriptionstatic DigestProvider.DigestSupport
create
(DigestProvider.DigestFunction digestFunction, DigestProvider.VerifyFunction verifyFunction) Create a new support based on digest and verify functions.digest
(byte[] bytes, boolean preHashed) Generates a signature or an HMAC.boolean
Verifies a signature or an HMAC.
-
Constructor Details
-
DigestSupport
protected DigestSupport(DigestProvider.DigestFunction digestFunction, DigestProvider.VerifyFunction verifyFunction) Digest support based on the two functions.- Parameters:
digestFunction
- digest functionverifyFunction
- verify function
-
-
Method Details
-
create
public static DigestProvider.DigestSupport create(DigestProvider.DigestFunction digestFunction, DigestProvider.VerifyFunction verifyFunction) Create a new support based on digest and verify functions.- Parameters:
digestFunction
- digest functionverifyFunction
- verify function- Returns:
- new digest support
-
digest
Generates a signature or an HMAC.- Parameters:
bytes
- bytes to signpreHashed
- whether the bytes are pre-hashed- Returns:
- future with the digest (signature or HMAC)
-
verify
Verifies a signature or an HMAC.- Parameters:
bytes
- bytes to verifypreHashed
- whether the bytes are pre-hasheddigest
- digest obtained from a third-part- Returns:
- future with
true
if the digest is valid,false
if not valid, and an error if not a supported digest
-