public class PKIXCMPUtils
extends java.lang.Object
| Constructor and Description |
|---|
PKIXCMPUtils(ManagerTransport mantransport)
Construct an EntrustPKIXCMP message given a ManagerTransport object.
|
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
createPasswordBasedMac(byte[] data,
byte[] password,
AlgorithmID passwordBasedMac)
Creates a password based MAC over the specified data.
|
GeneralMessageInfo |
getGeneralMessageInfo(SecureStringBuffer refNum,
AuthorizationCode authCode)
This API performs a PKIX general message transaction using the supplied
reference number and authorization code.
|
GeneralMessageInfo |
getGeneralMessageInfo(User user)
This API performs a PKIX general message transaction using the supplied
User object. |
PKIMessage |
receive()
Receives a PKIX-CMP response message over the Manager Transport.
|
void |
send(PKIMessage request)
Sends a PKIX-CMP request over the Manager Transport.
|
public PKIXCMPUtils(ManagerTransport mantransport)
mantransport - public void send(PKIMessage request) throws EntrustPKIXCMPException
If this class has been set to operate in DEBUG mode, a file containing the DER encoded request message will be written to the working directory.
request - the request message to be sent to the CAEntrustPKIXCMPException - thrown if there was a problem sending the PKIX-CMP requestpublic PKIMessage receive() throws EntrustPKIXCMPException
If this class has been set to operate in DEBUG mode, a file containing the DER encoded response message will be written to the working directory.
EntrustPKIXCMPException - thrown if there was a problem receiving the PKIX-CMP responsepublic GeneralMessageInfo getGeneralMessageInfo(SecureStringBuffer refNum, AuthorizationCode authCode) throws EntrustPKIXCMPException
GeneralMessageInfo object whose purpose is to encapsulate information
contained in a PKIX CMP General Message.
Note: If this API is called by a V2 key pair user, the manager log at the PKI may generate an error that says "A V1 client can no longer be used to manage user". This error message can be ignored.
refNum - The reference numberauthCode - The authorization codeEntrustPKIXCMPExceptionpublic GeneralMessageInfo getGeneralMessageInfo(User user) throws EntrustPKIXCMPException, UserNotLoggedInException
User object. This method returns a
GeneralMessageInfo object whose purpose is to encapsulate information
contained in a PKIX CMP General Message.user - The User objectEntrustPKIXCMPExceptionUserNotLoggedInExceptionpublic static byte[] createPasswordBasedMac(byte[] data,
byte[] password,
AlgorithmID passwordBasedMac)
throws EntrustPKIXCMPException
The MAC is calculated as a PasswordBasedMac with the salt, iteration count, one-way function algorithm, and MAC algorithm all extracted from the algorithm parameters. The password used is created from the authorization code provided.
First a key is created by appending the salt to the password and hashing this value with the one-way function the number of times specified in iteration count. Then the MAC using this key and the specified MAC algorithm.
data - the data to protect with the password based MACpassword - the password to MAC with (authorization code, ...)passwordBasedMac - the password based MAC algorithm identifier that the MAC will
be created forEntrustPKIXCMPException - if an error occurs during MAC creation