Skip navigation links

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

E10666-05


oracle.security.crypto.cmp
Class Challenge

java.lang.Object
  extended by oracle.security.crypto.cmp.Challenge

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

public class Challenge
extends java.lang.Object
implements oracle.security.crypto.asn1.ASN1Object

A proof-of-possession challenge for an individual private key.

See Also:
POPChallenge

Constructor Summary
Challenge()
          Create a new, empty Challenge.
Challenge(oracle.security.crypto.core.AlgorithmIdentifier digestAlg, java.math.BigInteger randomInt, oracle.security.crypto.cert.GeneralName sender, java.security.PublicKey pubKey)
          Create a new Challenge instance using the given digest algorithm, challenge random integer and sender's name, and encrypts the challenge using the given public key.
Challenge(byte[] witness, java.math.BigInteger randomInt, oracle.security.crypto.cert.GeneralName sender, java.security.PublicKey pubKey)
          Create a new Challenge instance using the given witness digest bytes, challenge random integer and sender's name, and encrypts the challenge using the given public key.
Challenge(java.io.InputStream is)
           

 

Method Summary
 oracle.security.crypto.core.AlgorithmIdentifier getDigestAlgID()
           
 java.math.BigInteger getRandomInt(java.security.PrivateKey privKey)
          Note the changes in the method signature
 oracle.security.crypto.cert.GeneralName getSender(java.security.PrivateKey privKey)
          Note the changes in the method signature
 byte[] getWitness()
           
 void input(java.io.InputStream is)
           
 int length()
           
 void output(java.io.OutputStream os)
           
 java.lang.String toString()
           

 

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

 

Constructor Detail

Challenge

public Challenge()
Create a new, empty Challenge.

Challenge

public Challenge(oracle.security.crypto.core.AlgorithmIdentifier digestAlg,
                 java.math.BigInteger randomInt,
                 oracle.security.crypto.cert.GeneralName sender,
                 java.security.PublicKey pubKey)
          throws java.security.NoSuchAlgorithmException,
                 java.security.InvalidKeyException,
                 javax.crypto.NoSuchPaddingException,
                 javax.crypto.IllegalBlockSizeException,
                 javax.crypto.BadPaddingException
Create a new Challenge instance using the given digest algorithm, challenge random integer and sender's name, and encrypts the challenge using the given public key.

Note the changes in the method signature

Previously public Challenge (AlgorithmIdentifier , BigInteger , GeneralName , oracle.security.crypto.core.PublicKey)

Nowpublic Challenge (AlgorithmIdentifier , BigInteger , GeneralName , java.security.PublicKey)

Note the change in the exceptions declared to be thrown.

Exceptions no longer thrown -- AlgorithmIdentifierException,CipherException

Exceptions introduced -- java.security.InvalidKeyException ,NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException,BadPaddingException

Parameters:
digestAlg - The digest algorithm used to produce the witness digest bytes.
randomInt - The random integer that will be encrypted to form the challenge (with the sender's name).
sender - The sender's name that will be encrypted to form the challenge (with the random integer).
pubKey - The public key of the recipient, which will be used to encrypt the challenge.
Throws:
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
javax.crypto.NoSuchPaddingException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException

Challenge

public Challenge(byte[] witness,
                 java.math.BigInteger randomInt,
                 oracle.security.crypto.cert.GeneralName sender,
                 java.security.PublicKey pubKey)
          throws java.security.NoSuchAlgorithmException,
                 java.security.InvalidKeyException,
                 javax.crypto.NoSuchPaddingException,
                 java.security.InvalidKeyException,
                 javax.crypto.IllegalBlockSizeException,
                 javax.crypto.BadPaddingException
Create a new Challenge instance using the given witness digest bytes, challenge random integer and sender's name, and encrypts the challenge using the given public key. The digest algorithm will be left null, in keeping with the CMP protocol.

Note the changes in the method signature

Previously public Challenge (byte[] , BigInteger , GeneralName , oracle.security.crypto.core.PublicKey)

Nowpublic Challenge (byte[] , BigInteger , GeneralName , java.security.PublicKey)

Note the change in the exceptions declared to be thrown.

Exceptions no longer thrown -- AlgorithmIdentifierException,CipherException

Exceptions introduced -- java.security.InvalidKeyException ,NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException,BadPaddingException

Parameters:
witness - The digest of the challenge random integer's bytes.
randomInt - The random integer that will be encrypted to form the challenge (with the sender's name).
sender - The sender's name that will be encrypted to form the challenge (with the random integer).
pubKey - The public key of the recipient, which will be used to encrypt the challenge.
Throws:
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
javax.crypto.NoSuchPaddingException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException

Challenge

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

Method Detail

getDigestAlgID

public oracle.security.crypto.core.AlgorithmIdentifier getDigestAlgID()

getWitness

public byte[] getWitness()

getRandomInt

public java.math.BigInteger getRandomInt(java.security.PrivateKey privKey)
                                  throws javax.crypto.NoSuchPaddingException,
                                         javax.crypto.IllegalBlockSizeException,
                                         javax.crypto.BadPaddingException

Note the changes in the method signature

Previously public BigInteger getRandomInt (oracle.security.crypto.core.PrivateKey )

Now public BigInteger getRandomInt (java.security.PrivateKey )

Note the change in the exceptions declared to be thrown.

Exceptions no longer thrown --CipherException

Exceptions introduced -- NoSuchPaddingException, IllegalBlockSizeException,BadPaddingException

Throws:
javax.crypto.NoSuchPaddingException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException

getSender

public oracle.security.crypto.cert.GeneralName getSender(java.security.PrivateKey privKey)
                                                  throws javax.crypto.NoSuchPaddingException,
                                                         javax.crypto.IllegalBlockSizeException,
                                                         javax.crypto.BadPaddingException

Note the changes in the method signature

Previously public GeneralName getSender (oracle.security.crypto.core.PrivateKey )

Now public GeneralName getSender (java.security.PrivateKey )

Note the change in the exceptions declared to be thrown.

Exceptions no longer thrown --CipherException

Exceptions introduced -- NoSuchPaddingException, IllegalBlockSizeException,BadPaddingException

Throws:
javax.crypto.NoSuchPaddingException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException

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
Specified by:
input in interface oracle.security.crypto.util.Streamable
Throws:
java.io.IOException

output

public void output(java.io.OutputStream os)
            throws java.io.IOException
Specified by:
output in interface oracle.security.crypto.util.Streamable
Throws:
java.io.IOException

length

public int length()
Specified by:
length in interface oracle.security.crypto.util.Streamable

Skip navigation links

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

E10666-05


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