com.aelitis.azureus.core.security
Interface CryptoHandler

All Known Implementing Classes:
CryptoHandlerECC

public interface CryptoHandler


Method Summary
 byte[] decrypt(byte[] other_public_key, byte[] data, String reason)
           
 byte[] encrypt(byte[] other_public_key, byte[] data, String reason)
           
 String exportKeys()
           
 int getDefaultPasswordHandlerType()
           
 byte[] getEncryptedPrivateKey(String reason)
           
 byte[] getPublicKey(String reason)
           
 CryptoSTSEngine getSTSEngine(PublicKey public_key, PrivateKey private_key)
           
 CryptoSTSEngine getSTSEngine(String reason)
           
 int getType()
           
 int getUnlockTimeoutSeconds()
           
 boolean importKeys(String str)
           
 boolean isUnlocked()
           
 void lock()
          Puts the handler back into a state where password will be required to access private stuff
 byte[] peekPublicKey()
           
 void recoverKeys(byte[] public_key, byte[] encrypted_private_key)
           
 void resetKeys(String reason)
           
 void setDefaultPasswordHandlerType(int new_type)
           
 void setUnlockTimeoutSeconds(int secs)
           
 byte[] sign(byte[] data, String reason)
           
 void unlock()
          Explicit unlock request
 boolean verify(byte[] public_key, byte[] data, byte[] signature)
           
 boolean verifyPublicKey(byte[] encoded)
           
 

Method Detail

getType

int getType()

unlock

void unlock()
            throws CryptoManagerException
Explicit unlock request

Throws:
CryptoManagerException

lock

void lock()
Puts the handler back into a state where password will be required to access private stuff


isUnlocked

boolean isUnlocked()

getUnlockTimeoutSeconds

int getUnlockTimeoutSeconds()

setUnlockTimeoutSeconds

void setUnlockTimeoutSeconds(int secs)
Parameters:
secs - 0-> infinite

sign

byte[] sign(byte[] data,
            String reason)
            throws CryptoManagerException
Throws:
CryptoManagerException

verify

boolean verify(byte[] public_key,
               byte[] data,
               byte[] signature)
               throws CryptoManagerException
Throws:
CryptoManagerException

encrypt

byte[] encrypt(byte[] other_public_key,
               byte[] data,
               String reason)
               throws CryptoManagerException
Throws:
CryptoManagerException

decrypt

byte[] decrypt(byte[] other_public_key,
               byte[] data,
               String reason)
               throws CryptoManagerException
Throws:
CryptoManagerException

getSTSEngine

CryptoSTSEngine getSTSEngine(String reason)
                             throws CryptoManagerException
Throws:
CryptoManagerException

getSTSEngine

CryptoSTSEngine getSTSEngine(PublicKey public_key,
                             PrivateKey private_key)
                             throws CryptoManagerException
Throws:
CryptoManagerException

peekPublicKey

byte[] peekPublicKey()

getPublicKey

byte[] getPublicKey(String reason)
                    throws CryptoManagerException
Throws:
CryptoManagerException

getEncryptedPrivateKey

byte[] getEncryptedPrivateKey(String reason)
                              throws CryptoManagerException
Throws:
CryptoManagerException

verifyPublicKey

boolean verifyPublicKey(byte[] encoded)

recoverKeys

void recoverKeys(byte[] public_key,
                 byte[] encrypted_private_key)
                 throws CryptoManagerException
Throws:
CryptoManagerException

resetKeys

void resetKeys(String reason)
               throws CryptoManagerException
Throws:
CryptoManagerException

exportKeys

String exportKeys()
                  throws CryptoManagerException
Throws:
CryptoManagerException

getDefaultPasswordHandlerType

int getDefaultPasswordHandlerType()

setDefaultPasswordHandlerType

void setDefaultPasswordHandlerType(int new_type)
                                   throws CryptoManagerException
Throws:
CryptoManagerException

importKeys

boolean importKeys(String str)
                   throws CryptoManagerException
Parameters:
str -
Returns:
true if an Azureus restart is required
Throws:
CryptoManagerException