diff options
Diffstat (limited to 'javax/crypto/Mac.java')
-rw-r--r-- | javax/crypto/Mac.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/javax/crypto/Mac.java b/javax/crypto/Mac.java index ea3e42ba6..2a269ab80 100644 --- a/javax/crypto/Mac.java +++ b/javax/crypto/Mac.java @@ -41,6 +41,7 @@ package javax.crypto; import gnu.java.security.Engine; import java.lang.reflect.InvocationTargetException; +import java.nio.ByteBuffer; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.Key; @@ -406,6 +407,18 @@ public class Mac implements Cloneable } /** + * Update this MAC with the remaining bytes in the given buffer + * @param buffer The input buffer. + * @since 1.5 + */ + public final void update (final ByteBuffer buffer) + { + if (virgin) + throw new IllegalStateException ("not initialized"); + macSpi.engineUpdate(buffer); + } + + /** * Clone this instance, if the underlying implementation supports it. * * @return A clone of this instance. |