public interface KeyManager
extends com.google.common.util.concurrent.Service
| Modifier and Type | Interface and Description |
|---|---|
static class |
KeyManager.DigestId
Represents the combination of a digest computed on a message using a secret key, and the ID of the secret key
used to compute the digest.
|
| Modifier and Type | Method and Description |
|---|---|
KeyManager.DigestId |
generateMAC(byte[] message)
Computes a digest for the given input message, using the current secret key.
|
<T> void |
validateMAC(Codec<T> codec,
Signed<T> signedMessage)
Recomputes the digest for the given message and verifies that it matches the provided value.
|
KeyManager.DigestId generateMAC(byte[] message) throws InvalidKeyException
message - The data over which we should generate a digest.InvalidKeyException - If the internal Mac implementation does not accept the given key.<T> void validateMAC(Codec<T> codec, Signed<T> signedMessage) throws InvalidDigestException, InvalidKeyException
codec - The serialization utility to use in serializing the message when recomputing the digestsignedMessage - The message and digest to validate.InvalidDigestExceptionInvalidKeyExceptionCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.