|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dist1.acb.common.Security
Security module
Method Summary | |
void |
decrypt(java.lang.String inputFileName,
java.lang.String outputFileName,
byte[] key)
Decrypts a file using triple-DES |
byte[] |
digest(java.lang.String string)
Creates a a hash for a string |
byte[] |
encrypt(java.lang.String inputFileName,
java.lang.String outputFileName)
Generates a key and ecrypt using triple-DES a file with that key |
static Security |
getInstance()
Get the only one instance |
java.lang.String |
getIssuedTo()
Getter for property issuedTo. |
javax.net.ServerSocketFactory |
getServerSocketFactory()
Obtain ServerSocketFactory |
javax.net.SocketFactory |
getSocketFactory()
Obtain SocketFactory with certificate |
void |
init(java.io.InputStream keys,
java.io.InputStream cert,
java.io.InputStream generatorAndPrime)
Initializes the Security obect. |
void |
init(java.lang.String keysFileName,
java.lang.String certFileName,
java.lang.String generatorAndPrimeFileName)
Initializes the Security obect. |
boolean |
zkCheckUser(java.math.BigInteger r,
java.math.BigInteger h,
java.math.BigInteger s,
java.math.BigInteger y)
Ckecks if the user knows the secret |
java.math.BigInteger |
zkCreateCommitment(java.math.BigInteger k)
Creates commitment r is g^k (mod q) |
java.math.BigInteger |
zkCreatePublicKey(java.lang.String password)
Generates the public key for the user |
java.math.BigInteger |
zkCreateSignature(java.math.BigInteger k,
java.math.BigInteger h,
java.lang.String password)
Creates signature for a password s = k+hx |
java.math.BigInteger |
zkRandom1024()
Generates a secure random number |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static Security getInstance()
public java.lang.String getIssuedTo()
public javax.net.ServerSocketFactory getServerSocketFactory()
public javax.net.SocketFactory getSocketFactory()
public void decrypt(java.lang.String inputFileName, java.lang.String outputFileName, byte[] key) throws java.lang.Exception
inputFileName
- the name of the file which will be decryptedoutputFileName
- the file reluted from decryptionkey
- the key
java.lang.Exception
- if the specified algorithm is not available in the
default provider package or any of the other provider packages
that were searchedpublic byte[] digest(java.lang.String string)
string
-
public byte[] encrypt(java.lang.String inputFileName, java.lang.String outputFileName) throws java.lang.Exception
inputFileName
- file to be encryptedoutputFileName
- the encrypted file
java.lang.Exception
- if the specified algorithm is not available in the
default provider package or any of the other provider packages
that were searchedpublic void init(java.lang.String keysFileName, java.lang.String certFileName, java.lang.String generatorAndPrimeFileName) throws java.lang.Exception
keysFileName
- from where the storeKey is loadedcertFileName
- from where the storeCert is loadedgeneratorAndPrimeFileName
- from where prime and corresponded
geterator (for Zero knowledge) is loaded
java.lang.Exception
- if something wrongpublic void init(java.io.InputStream keys, java.io.InputStream cert, java.io.InputStream generatorAndPrime) throws java.lang.Exception
keys
- from where the storeKey is loadedcert
- from where the storeCert is loadedgeneratorAndPrime
- from where prime and corresponded geterator is
loaded (for Zero Knowledge algorithm)
java.lang.Exception
- if something wrong
java.lang.RuntimeException
- if something wrongpublic boolean zkCheckUser(java.math.BigInteger r, java.math.BigInteger h, java.math.BigInteger s, java.math.BigInteger y)
r
- the commitmenth
- the nonce (a secure random number generate by the server)s
- the signature of the usery
- the public key of the user
public java.math.BigInteger zkCreateCommitment(java.math.BigInteger k)
k
- the secure random number generated by the user
public java.math.BigInteger zkCreatePublicKey(java.lang.String password)
password
- the password of the user
public java.math.BigInteger zkCreateSignature(java.math.BigInteger k, java.math.BigInteger h, java.lang.String password)
k
- a secure random number generate by the userh
- a secure random number generate by the serverpassword
- user's password
public java.math.BigInteger zkRandom1024()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |