|
SafeAPI v1.20 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.safeapi.CryptoCommon
com.safeapi.CryptoSym
Symmetric Cryptography APIs Module
Constructor Summary | |
CryptoSym()
Loads an instance of CryptoSym. |
Method Summary | |
byte[] |
decryptBuffer(String sKeyID,
char[] caPassphrase,
byte[] bBuffer)
Decrypts a buffer with a secret key |
byte[] |
decryptBufferKey(String sAlgorithm,
char[] caHexaKey,
byte[] bBuffer)
Decrypts a buffer with the key in hexadecimal format |
byte[] |
decryptBufferRawKey(String sAlgorithm,
byte[] bSecretKey,
byte[] bInitVector,
byte[] bBuffer)
Decrypts a buffer with the provided bytes used as key |
void |
decryptFile(String sKeyID,
char[] caPassphrase,
String sInputPath,
String sOutputPath)
Decrypts the specified file with a Key ID. |
byte[] |
encryptBuffer(String sKeyID,
char[] caPassphrase,
byte[] bBuffer)
Encrypts a buffer with a secret key |
byte[] |
encryptBufferKey(String sAlgorithm,
char[] caHexaKey,
byte[] bBuffer)
Encrypts a buffer with an hexadecimal key |
byte[] |
encryptBufferRawKey(String sAlgorithm,
byte[] bSecretKey,
byte[] bInitVector,
byte[] bBuffer)
Encrypts a buffer with the provided bytes used as key |
void |
encryptFile(String sKeyID,
char[] caPassphrase,
String sInputPath,
String sOutputPath)
Encrypt the specified file with a Key ID. |
void |
genSecretKey(String sAlgorithm,
char[] caPassphrase,
int nLength,
byte[] bSeed,
String sEmailSign,
int nIndex)
Generates a secret key for requested algorithm and length and with your seed. |
String |
getSecretKey(String sAlgorithm,
char[] caPassphrase,
String sEmail,
int nIndex)
Gets a secret key value in hexadecimal. |
Methods inherited from class com.safeapi.CryptoCommon |
createSeedFile, getParameter, getRandomBytes, getRawError, getRegisteredError, getVersion, isOperationOK, setParameter, wipe |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CryptoSym()
Method Detail |
public void genSecretKey(String sAlgorithm, char[] caPassphrase, int nLength, byte[] bSeed, String sEmailSign, int nIndex)
sAlgorithm
- The symmetric algorithm name (IDEA, Blowfish, CAST-128)caPassphrase
- The secret key passphrase protectionnLength
- The length for the key to generate (128 bits)bSeed
- The seed for the random used for generationsEmailSign
- The Email of the ownernIndex
- The Index of this keypublic String getSecretKey(String sAlgorithm, char[] caPassphrase, String sEmail, int nIndex)
sAlgorithm
- The symmetric algorithm name (IDEA, Blowfish, CAST-128)caPassphrase
- The secret key passphrase protectionsEmail
- The Email of the ownernIndex
- The Index of this keypublic byte[] encryptBuffer(String sKeyID, char[] caPassphrase, byte[] bBuffer)
sKeyID
- The Key IDcaPassphrase
- The secret key passphrase protectionbBuffer
- The buffer to encrypt
public byte[] encryptBufferKey(String sAlgorithm, char[] caHexaKey, byte[] bBuffer)
sAlgorithm
- The encryption algorithmcaHexaKey
- The key in hexadecimal formatbBuffer
- The buffer to encrypt
public byte[] encryptBufferRawKey(String sAlgorithm, byte[] bSecretKey, byte[] bInitVector, byte[] bBuffer)
sAlgorithm
- The encryption algorithmbSecretKey
- The bytes used as secret keybInitVector
- The initalization vectorbBuffer
- The buffer to encrypt
public byte[] decryptBuffer(String sKeyID, char[] caPassphrase, byte[] bBuffer)
sKeyID
- The Key IDcaPassphrase
- The secret key passphrase protectionbBuffer
- The buffer to decrypt
public byte[] decryptBufferKey(String sAlgorithm, char[] caHexaKey, byte[] bBuffer)
sAlgorithm
- The encryption algorithmcaHexaKey
- the key in hexadecimal formatbBuffer
- The buffer to decrypt
public byte[] decryptBufferRawKey(String sAlgorithm, byte[] bSecretKey, byte[] bInitVector, byte[] bBuffer)
sAlgorithm
- The encryption algorithmbSecretKey
- The bytes used as secret keybInitVector
- The initalization vectorbBuffer
- The buffer to encrypt
public void encryptFile(String sKeyID, char[] caPassphrase, String sInputPath, String sOutputPath)
sKeyID
- The Key IDcaPassphrase
- The secret key passphrase protectionsInputPath
- The full name of the file to encryptsOutputPath
- The encrypted file to createpublic void decryptFile(String sKeyID, char[] caPassphrase, String sInputPath, String sOutputPath)
sKeyID
- The Key IDcaPassphrase
- The passphrase for key protectionsInputPath
- The full name of the file to decryptsOutputPath
- The decrypted file to create
|
SafeAPI v1.20 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |