- java.lang.Object
-
- io.helidon.security.spi.DigestProvider.DigestSupport
-
- Enclosing interface:
- DigestProvider<T extends ProviderConfig>
public static class DigestProvider.DigestSupport extends Object
Digest support created for each named digest configuration, used bySecurity
forSecurity.digest(String, byte[])
andSecurity.verifyDigest(String, byte[], String)
methods.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DigestSupport(DigestProvider.DigestFunction digestFunction, DigestProvider.VerifyFunction verifyFunction)
Digest support based on the two functions.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DigestProvider.DigestSupport
create(DigestProvider.DigestFunction digestFunction, DigestProvider.VerifyFunction verifyFunction)
Create a new support based on digest and verify functions.Single<String>
digest(byte[] bytes, boolean preHashed)
Generates a signature or an HMAC.Single<Boolean>
verify(byte[] bytes, boolean preHashed, String digest)
Verifies a signature or an HMAC.
-
-
-
Constructor Detail
-
DigestSupport
protected DigestSupport(DigestProvider.DigestFunction digestFunction, DigestProvider.VerifyFunction verifyFunction)
Digest support based on the two functions.- Parameters:
digestFunction
- digest functionverifyFunction
- verify function
-
-
Method Detail
-
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
public Single<String> digest(byte[] bytes, boolean preHashed)
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
public Single<Boolean> verify(byte[] bytes, boolean preHashed, String digest)
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
-
-