Skip navigation links

Oracle Fusion Middleware PKI SDK CMP Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10666-03


oracle.security.crypto.cmp
Class POPChallenge

java.lang.Object
  extended by oracle.security.crypto.cmp.PKIMessageBody
      extended by oracle.security.crypto.cmp.POPChallenge

All Implemented Interfaces:
oracle.security.crypto.asn1.ASN1Object, oracle.security.crypto.util.Streamable

public class POPChallenge
extends PKIMessageBody

PKI message body of type POP Challenge.

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.

See Also:
Challenge, POPResponse

Nested Class Summary

 

Nested classes/interfaces inherited from class oracle.security.crypto.cmp.PKIMessageBody
PKIMessageBody.Type

 

Constructor Summary
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)
           

 

Method Summary
 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.

 

Methods inherited from class oracle.security.crypto.cmp.PKIMessageBody
inputInstance, length, output

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

POPChallenge

public POPChallenge()
Create a new, empty POPChallenge message body. Since such an object is not valid, this constructor is intended primarily for use with the input(java.io.InputStream) method.

POPChallenge

public POPChallenge(Challenge challenge)
Create a new POPChallenge message body with the specified challenge.

POPChallenge

public POPChallenge(java.io.InputStream is)
             throws java.io.IOException
Throws:
java.io.IOException

Method Detail

addChallenge

public void addChallenge(Challenge challenge)
Add a Challenge to this challenge message body.

getChallenges

public java.util.Vector getChallenges()
Get challenges included in this message body.
Returns:
a Vector containing the challenges if any, otherwise null.

verify

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
Verifies that the specified challenge is valid.

This method verifies the challenge by:

Parameters:
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.
Returns:
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

Throws:
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.BadPaddingException
javax.crypto.NoSuchPaddingException
javax.crypto.IllegalBlockSizeException

getType

public PKIMessageBody.Type getType()
Description copied from class: PKIMessageBody
Returns one of the values defined in PKIMessageBody.Type.
Specified by:
getType in class PKIMessageBody

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

input

public void input(java.io.InputStream is)
           throws java.io.IOException
Initializes this object by reading its encoding from the given input stream.
Throws:
java.io.IOException

Skip navigation links

Oracle Fusion Middleware PKI SDK CMP Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10666-03


Copyright © 2005, 2011 , Oracle. All rights reserved.