public class PGPUtil extends java.lang.Object implements HashAlgorithmTags
DOUBLE_SHA, HAVAL_5_160, MD2, MD5, RIPEMD160, SHA1, SHA224, SHA256, SHA384, SHA512, TIGER_192| Constructor and Description |
|---|
PGPUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.io.InputStream |
getDecoderStream(java.io.InputStream in)
Return either an ArmoredInputStream or a BCPGInputStream based on
whether the initial characters of the stream are binary PGP encodings or not.
|
static java.lang.String |
getDefaultProvider()
Return the provider that will be used by factory classes in situations
where a provider must be determined on the fly.
|
static byte[] |
makeRandomKey(int algorithm,
java.security.SecureRandom random) |
static void |
setDefaultProvider(java.lang.String provider)
Set the provider to be used by the package when it is necessary to
find one on the fly.
|
static void |
writeFileToLiteralData(java.io.OutputStream out,
char fileType,
java.io.File file)
write out the passed in file as a literal data packet.
|
static void |
writeFileToLiteralData(java.io.OutputStream out,
char fileType,
java.io.File file,
byte[] buffer)
write out the passed in file as a literal data packet in partial packet format.
|
public static java.lang.String getDefaultProvider()
public static void setDefaultProvider(java.lang.String provider)
provider - public static byte[] makeRandomKey(int algorithm,
java.security.SecureRandom random)
throws PGPException
PGPExceptionpublic static void writeFileToLiteralData(java.io.OutputStream out,
char fileType,
java.io.File file)
throws java.io.IOException
out - fileType - the LiteralData type for the file.file - java.io.IOExceptionpublic static void writeFileToLiteralData(java.io.OutputStream out,
char fileType,
java.io.File file,
byte[] buffer)
throws java.io.IOException
out - fileType - the LiteralData type for the file.file - buffer - buffer to be used to chunk the file into partial packets.java.io.IOExceptionpublic static java.io.InputStream getDecoderStream(java.io.InputStream in)
throws java.io.IOException
in - the stream to be wrappedjava.io.IOException