Project CASUAL
API for CASUAL
 All Classes Namespaces Functions Variables
Public Member Functions | Static Public Member Functions | Static Protected Attributes | List of all members
CASUAL.crypto.SHA256sum Class Reference

Public Member Functions

 SHA256sum (String s) throws IOException
 
 SHA256sum (InputStream is) throws IOException
 
 SHA256sum (File f) throws FileNotFoundException, IOException
 
String getLinuxSum (String filename)
 
String getSha256 () throws IOException, NoSuchAlgorithmException
 
String toString ()
 
 SHA256sum (String s) throws IOException
 
 SHA256sum (InputStream is) throws IOException
 
 SHA256sum (File f) throws FileNotFoundException, IOException
 
String getLinuxSum (String filename)
 
String getSha256 () throws IOException, NoSuchAlgorithmException
 
String toString ()
 

Static Public Member Functions

static String getLinuxSum (File file)
 
static String getName (String sha256sum)
 
static String getSum (String sha256sum)
 
static String bytesToHex (byte[] bytes)
 
static String formatLinuxOutputSHA256Sum (String sum, String name)
 
static String getLinuxSum (File file)
 
static String getName (String sha256sum)
 
static String getSum (String sha256sum)
 
static String bytesToHex (byte[] bytes)
 
static String formatLinuxOutputSHA256Sum (String sum, String name)
 

Static Protected Attributes

final static String LINUXSPACER = " "
 

Detailed Description

provides several methods for md256 standards

Author
Adam Outler adamo.nosp@m.utle.nosp@m.r@gma.nosp@m.il.c.nosp@m.om attempts to replicates linux's sha256sum.. there appears to be a problem with Linux when tested against test vectors from this page: http://www.nsrl.nist.gov/testdata/ I will need to review all data and figure out how to implement this later

ad5f9292c7bd44068b5465b48b38bf18c98b4d133e80307957e5f5c372a36f7d logo.xcf

Author
Adam Outler adamo.nosp@m.utle.nosp@m.r@gma.nosp@m.il.c.nosp@m.om

Constructor & Destructor Documentation

CASUAL.crypto.SHA256sum.SHA256sum ( String  s) throws IOException

constructor to make an SHA256 from a string

Parameters
sstring to sha256
Exceptions
IOException
CASUAL.crypto.SHA256sum.SHA256sum ( InputStream  is) throws IOException

constructor to make an SHA256 from an InputStream

Parameters
isinputstream to sha256
Exceptions
IOException
CASUAL.crypto.SHA256sum.SHA256sum ( File  f) throws FileNotFoundException, IOException

constructor to sha256 a file

Parameters
ffile to digest
Exceptions
FileNotFoundException
IOException
CASUAL.crypto.SHA256sum.SHA256sum ( String  s) throws IOException

constructor to make an SHA256 from a string

Parameters
sstring to sha256
Exceptions
IOException
CASUAL.crypto.SHA256sum.SHA256sum ( InputStream  is) throws IOException

constructor to make an SHA256 from an InputStream

Parameters
isinputstream to sha256
Exceptions
IOException
CASUAL.crypto.SHA256sum.SHA256sum ( File  f) throws FileNotFoundException, IOException

constructor to sha256 a file

Parameters
ffile to digest
Exceptions
FileNotFoundException
IOException

Member Function Documentation

static String CASUAL.crypto.SHA256sum.bytesToHex ( byte[]  bytes)
static

converts a byte array to hexadecimal output

Parameters
bytesto be turned into hex
Returns
hex string from bytes
static String CASUAL.crypto.SHA256sum.bytesToHex ( byte[]  bytes)
static

converts a byte array to hexadecimal output

Parameters
bytesto be turned into hex
Returns
hex string from bytes
static String CASUAL.crypto.SHA256sum.formatLinuxOutputSHA256Sum ( String  sum,
String  name 
)
static

formats a sha256sum from a sum and a filename

Parameters
sumthe sha256 sum
namethe file name
Returns
equal to command line output from linux sha256sum command
static String CASUAL.crypto.SHA256sum.formatLinuxOutputSHA256Sum ( String  sum,
String  name 
)
static

formats a sha256sum from a sum and a filename

Parameters
sumthe sha256 sum
namethe file name
Returns
equal to command line output from linux sha256sum command
static String CASUAL.crypto.SHA256sum.getLinuxSum ( File  file)
static

returns SHA256 sum in standard linux command line format

Parameters
fileto use for filename
Returns
linux sha256sum output
static String CASUAL.crypto.SHA256sum.getLinuxSum ( File  file)
static

returns SHA256 sum in standard linux command line format

Parameters
fileto use for filename
Returns
linux sha256sum output
String CASUAL.crypto.SHA256sum.getLinuxSum ( String  filename)

returns SHA256 sum in standard linux command line format

Parameters
filenameto use for filename
Returns
linux sha256sum output
String CASUAL.crypto.SHA256sum.getLinuxSum ( String  filename)

returns SHA256 sum in standard linux command line format

Parameters
filenameto use for filename
Returns
linux sha256sum output
static String CASUAL.crypto.SHA256sum.getName ( String  sha256sum)
static

gets the filename from a commandline sha256sum output

Parameters
sha256sumlinux sha256sum to extract name from
Returns
name of file mentioned in sha256sum
static String CASUAL.crypto.SHA256sum.getName ( String  sha256sum)
static

gets the filename from a commandline sha256sum output

Parameters
sha256sumlinux sha256sum to extract name from
Returns
name of file mentioned in sha256sum
String CASUAL.crypto.SHA256sum.getSha256 ( ) throws IOException, NoSuchAlgorithmException

does the SHA256

Returns
hex string representation of the input
Exceptions
IOException
NoSuchAlgorithmException
String CASUAL.crypto.SHA256sum.getSha256 ( ) throws IOException, NoSuchAlgorithmException

does the SHA256

Returns
hex string representation of the input
Exceptions
IOException
NoSuchAlgorithmException
static String CASUAL.crypto.SHA256sum.getSum ( String  sha256sum)
static

gets the sha256sum portion of a commandline sha256 output

Parameters
sha256sumlinux sha256sum to extract sum from
Returns
sum portion of command line sha256 output
static String CASUAL.crypto.SHA256sum.getSum ( String  sha256sum)
static

gets the sha256sum portion of a commandline sha256 output

Parameters
sha256sumlinux sha256sum to extract sum from
Returns
sum portion of command line sha256 output

Member Data Documentation

final static String CASUAL.crypto.SHA256sum.LINUXSPACER = " "
staticprotected

spacer used to separate SHA256 and filename in standard sha256sum


The documentation for this class was generated from the following file: