public class MacOutputStream extends java.io.OutputStream
Mac
(message authentication code algorithm). This is currently
used for symmetric (private) keys, but in theory could be used with assymetric (public/private) keys.Constructor and Description |
---|
MacOutputStream(javax.crypto.Mac mac) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getResult()
Should only be invoked once, immediately after this stream is closed; it generates the final MAC result, and
returns it as a Base64 encoded string.
|
static MacOutputStream |
streamFor(java.security.Key key) |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public MacOutputStream(javax.crypto.Mac mac)
public static MacOutputStream streamFor(java.security.Key key) throws java.io.IOException
java.io.IOException
public java.lang.String getResult()
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
${project.version} - Copyright © 2003-2015 The Apache Software Foundation.