|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.atp.auth.Auth | +--com.ibm.atp.auth.AuthBySignature
The AuthBySignature class is the class for challenge-response authentication by message digest.
Fields inherited from class com.ibm.atp.auth.Auth |
FIRST_TURN, NO_TURNS, SECOND_TURN |
Constructor Summary | |
protected |
AuthBySignature()
Default constructor creates a default message digest function. |
protected |
AuthBySignature(java.security.PrivateKey privateKey,
java.security.PublicKey publicKey)
Constructor creates a default message digest function. |
protected |
AuthBySignature(java.lang.String digestName)
Constructor creates a specified message digest function. |
protected |
AuthBySignature(java.lang.String digestName,
java.security.PrivateKey privateKey,
java.security.PublicKey publicKey)
Constructor creates a specified message digest function. |
protected |
AuthBySignature(java.lang.String digestName,
java.lang.String signatureName)
Constructor creates a specified message digest function. |
protected |
AuthBySignature(java.lang.String digestName,
java.lang.String signatureName,
java.security.PrivateKey privateKey,
java.security.PublicKey publicKey)
Constructor creates a specified message digest function. |
Method Summary | |
byte[] |
calculateResponse(int turn,
Challenge challenge)
Calculate response value for authentication. |
java.security.PrivateKey |
getPrivateKey()
Gets the private key of self. |
java.security.PublicKey |
getPublicKey()
Gets the public key of opponent. |
java.lang.String |
getSignatureAlgorithm()
Returns the name of digital signature algorithm. |
protected byte[] |
hash(int turn,
Challenge challenge)
Calculate hashed value for authentication. |
protected void |
setPrivateKey(java.security.PrivateKey privateKey)
Sets the private key of self. |
protected void |
setPublicKey(java.security.PublicKey publicKey)
Sets the public key of opponent. |
protected void |
setSignatureAlgorithm(java.lang.String name)
Sets the name of digital signature algorithm. |
protected byte[] |
sign(int turn,
Challenge challenge)
Calculate signature |
boolean |
verify(int turn,
Challenge challenge,
byte[] signature)
Verify signature |
boolean |
verify(int turn,
Challenge challenge,
ByteSequence signature)
Verify signature |
Methods inherited from class com.ibm.atp.auth.Auth |
addBytes, getDigestAlgorithm, getDigestValue, getFirstTurnIdentifier, getSecondTurnIdentifier, getTurnPad, resetDigest, setDigestAlgorithm, setFirstTurnIdentifier, setSecondTurnIdentifier |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected AuthBySignature()
protected AuthBySignature(java.lang.String digestName)
digestName
- the name of message digest function algorithmprotected AuthBySignature(java.lang.String digestName, java.lang.String signatureName)
digestName
- the name of message digest function algorithmsignatureName
- the name of message digest function algorithmprotected AuthBySignature(java.lang.String digestName, java.lang.String signatureName, java.security.PrivateKey privateKey, java.security.PublicKey publicKey)
digestName
- the name of message digest function algorithmsignatureName
- the name of message digest function algorithmprivateKey
- private key of selfpublicKey
- public key of opponentprotected AuthBySignature(java.lang.String digestName, java.security.PrivateKey privateKey, java.security.PublicKey publicKey)
digestName
- the name of message digest function algorithmprivateKey
- private key of selfpublicKey
- public key of opponentprotected AuthBySignature(java.security.PrivateKey privateKey, java.security.PublicKey publicKey)
privateKey
- private key of selfpublicKey
- public key of opponentMethod Detail |
public final byte[] calculateResponse(int turn, Challenge challenge) throws AuthenticationException
calculateResponse
in class Auth
turn
- of individualchallenge
- a challengeAuthenticationException
- byte sequence for response is invalidpublic java.security.PrivateKey getPrivateKey()
public java.security.PublicKey getPublicKey()
public java.lang.String getSignatureAlgorithm()
protected final byte[] hash(int turn, Challenge challenge) throws AuthenticationException
hash
in class Auth
turn
- of individualchallenge
- a challengeAuthenticationException
- byte sequence for response is invalidprotected void setPrivateKey(java.security.PrivateKey privateKey)
privateKey
- private key of selfprotected void setPublicKey(java.security.PublicKey publicKey)
publicKey
- public key of opponentprotected void setSignatureAlgorithm(java.lang.String name)
name
- the name of digital signature algorithmprotected final byte[] sign(int turn, Challenge challenge) throws AuthenticationException
turn
- of individualchallenge
- a challengeAuthenticationException
- byte sequence for response is invalidpublic final boolean verify(int turn, Challenge challenge, byte[] signature) throws AuthenticationException
verify
in class Auth
turn
- of individualchallenge
- a challengeresponse
- response value for authenticationAuthenticationException
- byte sequence for response is invalidpublic final boolean verify(int turn, Challenge challenge, ByteSequence signature) throws AuthenticationException
verify
in class Auth
turn
- of individualchallenge
- a challengeresponse
- response value for authenticationAuthenticationException
- byte sequence for response is invalid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |