|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.upb.swtpra05.group03.crypto.Crypto
de.upb.swtpra05.group03.crypto.BobCrypto
crypto class used for the 'bob' role known from DiffieHellman example
| Field Summary | |
private javax.crypto.KeyAgreement |
keyAgree
object used for the key agreement |
private java.security.KeyPairGenerator |
keyPairGen
used to generate a public private key pair |
private java.security.SecureRandom |
random
random number generator used for key agreement |
| Fields inherited from class de.upb.swtpra05.group03.crypto.Crypto |
AGREEMENT_ALGORITHM, CIPHER_ALGORITHM, KEY_ALGORITHM, pubKeyFactory, SIGNATURE_ALGORITHM, signer, state, STATE_INIT, STATE_READY, STATE_WAITING, verifyer |
| Constructor Summary | |
BobCrypto()
Constructor |
|
| Method Summary | |
DataSigPair |
generatePublicKey(DataSigPair dsp)
generates a public key for the key agreement by using the others public key and creates the secret key |
void |
reset()
reset the state to INIT so a new key agreement can be made |
void |
saveSeed()
saves the seed of the random number generator into a file |
| Methods inherited from class de.upb.swtpra05.group03.crypto.Crypto |
decryptObject, encryptObject, genPublicKeyFromX509, getSecretKey, isReady, loadSigningKeys, setSecretKey, setSecretKey, sign, verify |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private final javax.crypto.KeyAgreement keyAgree
private java.security.SecureRandom random
private final java.security.KeyPairGenerator keyPairGen
| Constructor Detail |
public BobCrypto()
throws java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException
javax.crypto.NoSuchPaddingException
java.security.NoSuchAlgorithmException| Method Detail |
public DataSigPair generatePublicKey(DataSigPair dsp)
throws java.security.SignatureException,
java.security.NoSuchAlgorithmException,
java.security.spec.InvalidKeySpecException,
java.security.InvalidAlgorithmParameterException,
java.security.InvalidKeyException
dsp - object containing key and signature
java.security.SignatureException
java.security.NoSuchAlgorithmException
java.security.spec.InvalidKeySpecException
java.security.InvalidAlgorithmParameterException
java.security.InvalidKeyExceptionpublic void saveSeed()
public void reset()
Cryptostate to INIT so a new key agreement can be made
reset in class Crypto
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||