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, java.lang.String reason)
           
 byte[] encrypt(byte[] other_public_key, byte[] data, java.lang.String reason)
           
 java.lang.String exportKeys()
           
 int getDefaultPasswordHandlerType()
           
 byte[] getEncryptedPrivateKey(java.lang.String reason)
           
 byte[] getPublicKey(java.lang.String reason)
           
 CryptoSTSEngine getSTSEngine(java.security.PublicKey public_key, java.security.PrivateKey private_key)
           
 CryptoSTSEngine getSTSEngine(java.lang.String reason)
           
 int getType()
           
 int getUnlockTimeoutSeconds()
           
 boolean importKeys(java.lang.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(java.lang.String reason)
           
 void setDefaultPasswordHandlerType(int new_type)
           
 void setUnlockTimeoutSeconds(int secs)
           
 byte[] sign(byte[] data, java.lang.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,
            java.lang.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,
               java.lang.String reason)
               throws CryptoManagerException
Throws:
CryptoManagerException

decrypt

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

getSTSEngine

CryptoSTSEngine getSTSEngine(java.lang.String reason)
                             throws CryptoManagerException
Throws:
CryptoManagerException

getSTSEngine

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

peekPublicKey

byte[] peekPublicKey()

getPublicKey

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

getEncryptedPrivateKey

byte[] getEncryptedPrivateKey(java.lang.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(java.lang.String reason)
               throws CryptoManagerException
Throws:
CryptoManagerException

exportKeys

java.lang.String exportKeys()
                            throws CryptoManagerException
Throws:
CryptoManagerException

getDefaultPasswordHandlerType

int getDefaultPasswordHandlerType()

setDefaultPasswordHandlerType

void setDefaultPasswordHandlerType(int new_type)
                                   throws CryptoManagerException
Throws:
CryptoManagerException

importKeys

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