SafeAPI v1.20

com.safeapi
Class CryptoCommon

java.lang.Object
  extended bycom.safeapi.CryptoCommon
Direct Known Subclasses:
CryptoAsym, CryptoAsymRawRSA, CryptoDir, CryptoHash, CryptoSym

public abstract class CryptoCommon
extends Object

Defines methods to all SafeAPI sister CryptoXxx classes; must not be used directly and is instancied by sister CryptoXxx classes.

CryptoCommon contains


Constructor Summary
CryptoCommon()
          Loads an instance of CryptoCommon.
 
Method Summary
 void createSeedFile(String sTitle, String sCaption)
          Generates a new random seed file.
 String getParameter(String sParmName)
          Get API Parameters.
 byte[] getRandomBytes(String sMsg4K)
          Generates 24 pseudo random bytes using the provided data (should be 4K) as a seed.
 String getRawError()
          Returns the necessary infos about last error
 String getRegisteredError()
          Returns the status code for a registered error and CRYPTO_UNKNOWN_ERROR for a unregistered one.
 String getVersion()
          Returns a string with API name, version and release date.
 boolean isOperationOK()
          Indicates whereas the last operation succeeded or not
 boolean setParameter(String sParmName, String sValue)
          Set API parameters.
 void wipe(String sFilePath, int nSecurityLevel)
          Wipe the specified file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CryptoCommon

public CryptoCommon()
Loads an instance of CryptoCommon.

Method Detail

isOperationOK

public boolean isOperationOK()
Indicates whereas the last operation succeeded or not

Returns:
true if last operation ended successfully, false if not

getParameter

public String getParameter(String sParmName)
Get API Parameters.
Parameters list can be found in Parms.

Parameters:
sParmName - the name of the parameter to update
Returns:
the present value for this parameter

setParameter

public boolean setParameter(String sParmName,
                            String sValue)
Set API parameters.
Parameters list can be found in Parms.

Parameters:
sParmName - The name for the parameter to modify
sValue - The new value for this parameter
Returns:
true if a modification has been done and false if not

getVersion

public String getVersion()
Returns a string with API name, version and release date.

Returns:
API name, version and release date

getRegisteredError

public String getRegisteredError()
Returns the status code for a registered error and CRYPTO_UNKNOWN_ERROR for a unregistered one.

The status codes string values are defined in Status

Returns:
code for the last error

getRawError

public String getRawError()
Returns the necessary infos about last error

Returns:
infos about last error

createSeedFile

public void createSeedFile(String sTitle,
                           String sCaption)
Generates a new random seed file.

Parameters:
sTitle - The seed window title
sCaption - The seed window caption

getRandomBytes

public byte[] getRandomBytes(String sMsg4K)
Generates 24 pseudo random bytes using the provided data (should be 4K) as a seed. Then return these bytes.

Parameters:
sMsg4K - The data to use as seed
Returns:
24 pseudo random bytes

wipe

public void wipe(String sFilePath,
                 int nSecurityLevel)
Wipe the specified file. You can choose your security level: The first 2 times are always with all 1 and all 0 patterns. The other overwrites are with different pseudo random patterns.

Parameters:
sFilePath - the file to delete
nSecurityLevel - Between 1 (Low) and 3 (High)

SafeAPI v1.20

Copyright © SafeLogic 2005