|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jclouds.crypto.CryptoStreams
@Beta public class CryptoStreams
functions related to but not in ByteStreams
| Constructor Summary | |
|---|---|
CryptoStreams()
|
|
| Method Summary | |
|---|---|
static String |
base64(byte[] in)
|
static byte[] |
base64(String in)
|
static byte[] |
base64Decode(com.google.common.io.InputSupplier<? extends InputStream> supplier)
Computes and returns the unencoded value for an input stream which is encoded in Base64. |
static String |
base64Encode(com.google.common.io.InputSupplier<? extends InputStream> supplier)
Computes and returns the base64 value for a supplied input stream. |
static byte[] |
digest(com.google.common.io.InputSupplier<? extends InputStream> supplier,
MessageDigest md)
Computes and returns the Digest value for a supplied input stream. |
static String |
hex(byte[] in)
|
static byte[] |
hex(String s)
|
static byte[] |
hexDecode(com.google.common.io.InputSupplier<? extends InputStream> supplier)
Computes and returns the unencoded value for an input stream which is encoded in hex. |
static String |
hexEncode(com.google.common.io.InputSupplier<? extends InputStream> supplier)
Computes and returns the hex value for a supplied input stream. |
static byte[] |
mac(com.google.common.io.InputSupplier<? extends InputStream> supplier,
Mac mac)
Computes and returns the MAC value for a supplied input stream. |
static String |
macBase64(com.google.common.io.InputSupplier<? extends InputStream> supplier,
Mac mac)
Computes and returns the MAC value for a supplied input stream. |
static byte[] |
md5(byte[] in)
|
static byte[] |
md5(com.google.common.io.InputSupplier<? extends InputStream> supplier)
Computes and returns the MD5 value for a supplied input stream. |
static String |
md5Base64(com.google.common.io.InputSupplier<? extends InputStream> supplier)
|
static String |
md5Hex(com.google.common.io.InputSupplier<? extends InputStream> supplier)
|
static byte[] |
sha1(byte[] in)
|
static byte[] |
sha1(com.google.common.io.InputSupplier<? extends InputStream> supplier)
Computes and returns the SHA1 value for a supplied input stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CryptoStreams()
| Method Detail |
|---|
public static String hex(byte[] in)
public static byte[] hex(String s)
public static String base64(byte[] in)
public static byte[] base64(String in)
public static String md5Hex(com.google.common.io.InputSupplier<? extends InputStream> supplier)
throws IOException
IOExceptionmd5(com.google.common.io.InputSupplier extends java.io.InputStream>),
hex(byte[])
public static String md5Base64(com.google.common.io.InputSupplier<? extends InputStream> supplier)
throws IOException
IOExceptionmd5(com.google.common.io.InputSupplier extends java.io.InputStream>),
base64(byte[])
public static String macBase64(com.google.common.io.InputSupplier<? extends InputStream> supplier,
Mac mac)
throws IOException
supplier - the input stream factorymac - the mac object
Mac.doFinal() after updating the mac object
with all of the bytes in the stream and encoding in Base64
IOException - if an I/O error occurs
public static byte[] digest(com.google.common.io.InputSupplier<? extends InputStream> supplier,
MessageDigest md)
throws IOException
supplier - the input stream factorymd - the digest object
MessageDigest.digest() after updating the
digest object with all of the bytes in the stream
IOException - if an I/O error occurs
public static byte[] sha1(com.google.common.io.InputSupplier<? extends InputStream> supplier)
throws IOException
digest(com.google.common.io.InputSupplier extends java.io.InputStream>, java.security.MessageDigest) to be more efficient.
supplier - the input stream factory
MessageDigest.digest() after updating the
sha1 object with all of the bytes in the stream
IOException - if an I/O error occurspublic static byte[] sha1(byte[] in)
public static byte[] md5(com.google.common.io.InputSupplier<? extends InputStream> supplier)
throws IOException
digest(com.google.common.io.InputSupplier extends java.io.InputStream>, java.security.MessageDigest) to be more efficient.
supplier - the input stream factory
MessageDigest.digest() after updating the
md5 object with all of the bytes in the stream
IOException - if an I/O error occurspublic static byte[] md5(byte[] in)
public static byte[] mac(com.google.common.io.InputSupplier<? extends InputStream> supplier,
Mac mac)
throws IOException
supplier - the input stream factorymac - the mac object
Mac.doFinal() after updating the mac object
with all of the bytes in the stream
IOException - if an I/O error occurs
public static String base64Encode(com.google.common.io.InputSupplier<? extends InputStream> supplier)
throws IOException
supplier - the input stream factory
IOException - if an I/O error occurs
public static byte[] base64Decode(com.google.common.io.InputSupplier<? extends InputStream> supplier)
throws IOException
supplier - the input stream factory
IOException - if an I/O error occurs
public static String hexEncode(com.google.common.io.InputSupplier<? extends InputStream> supplier)
throws IOException
supplier - the input stream factory
IOException - if an I/O error occurs
public static byte[] hexDecode(com.google.common.io.InputSupplier<? extends InputStream> supplier)
throws IOException
supplier - the input stream factory
IOException - if an I/O error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||