public class POPChallenge extends PKIMessageBody
This message conveys a sequence of encrypted challenges, intended to demonstrate possession of a decryption private key, in the same order as the original certificate requests were presented.
Challenge, POPResponsePKIMessageBody.Type| Constructor and Description |
|---|
POPChallenge()
Create a new, empty
POPChallenge message body. |
POPChallenge(Challenge challenge)
Create a new
POPChallenge message body with the specified challenge. |
POPChallenge(java.io.InputStream is) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChallenge(Challenge challenge)
Add a
Challenge to this challenge message body. |
java.util.Vector |
getChallenges()
Get challenges included in this message body.
|
PKIMessageBody.Type |
getType()
Returns one of the values defined in
PKIMessageBody.Type. |
void |
input(java.io.InputStream is)
Initializes this object by reading its encoding from the given input stream.
|
java.lang.String |
toString() |
boolean |
verify(int challengeIndex, oracle.security.crypto.cert.GeneralName sender, java.security.PrivateKey privKey)
Verifies that the specified challenge is valid.
|
inputInstance, length, outputpublic POPChallenge()
POPChallenge message body. Since such an object is not valid, this constructor is intended primarily for use with the input(java.io.InputStream) method.public POPChallenge(Challenge challenge)
POPChallenge message body with the specified challenge.
public POPChallenge(java.io.InputStream is)
throws java.io.IOException
java.io.IOExceptionpublic void addChallenge(Challenge challenge)
Challenge to this challenge message body.public java.util.Vector getChallenges()
Vector containing the challenges if any, otherwise null.
public boolean verify(int challengeIndex,
oracle.security.crypto.cert.GeneralName sender,
java.security.PrivateKey privKey)
throws java.security.NoSuchAlgorithmException,
java.security.InvalidKeyException,
javax.crypto.BadPaddingException,
javax.crypto.NoSuchPaddingException,
javax.crypto.IllegalBlockSizeException
This method verifies the challenge by:
challengeIndex - The sequential number of the challenge to verify (withing this POPChallenge's sequence of individual challenges).sender - The GeneralName of the PKI message sender, to be compared with the challenge sender.privKey - The private key to decrypt the challenge.true if the challenge is verified, otherwise false.
Note the changes in the method signature
Previously public boolean verify (int , GeneralName , oracle.security.crypto.core.PrivateKey )
Now public boolean verify (int, GeneralName , java.security.PrivateKey )
Note the changes in the exceptions thrown
Exceptions no longer thrown -- AlgorithmIdentifierException
Exceptions introduced -- NoSuchAlgorithmException, java.security.InvalidKeyException, BadPaddingException,NoSuchPaddingException, IllegalBlockSizeException
java.security.NoSuchAlgorithmException - if the witness digest algorithm in the challenge is invalid.java.security.InvalidKeyException - if the private key is invalid.BadPaddingException,NoSuchPaddingException,IllegalBlockSizeException - if an error occurs while decrypting the challenge.javax.crypto.BadPaddingExceptionjavax.crypto.NoSuchPaddingExceptionjavax.crypto.IllegalBlockSizeExceptionpublic PKIMessageBody.Type getType()
PKIMessageBodyPKIMessageBody.Type.getType in class PKIMessageBodypublic java.lang.String toString()
toString in class java.lang.Object
public void input(java.io.InputStream is)
throws java.io.IOException
java.io.IOException