org.netserv.ipauth.util
Class CmpHelper

java.lang.Object
  extended by org.netserv.ipauth.util.CmpHelper

public class CmpHelper
extends java.lang.Object

Author:
allents

Constructor Summary
CmpHelper()
           
 
Method Summary
static byte[] createNonce()
           
static com.novosec.pkix.asn1.cmp.PKIHeader createPKIHeader(org.bouncycastle.asn1.x509.X509Name sender, org.bouncycastle.asn1.x509.X509Name recipient)
           
static com.novosec.pkix.asn1.cmp.PKIMessage parsePkiMessage(byte[] message)
           
static byte[] pkiMessageToByteArray(com.novosec.pkix.asn1.cmp.PKIMessage msg)
           
static com.novosec.pkix.asn1.cmp.PKIMessage protectPKIMessageWithCert(com.novosec.pkix.asn1.cmp.PKIMessage msg, org.bouncycastle.asn1.x509.X509CertificateStructure cert, java.security.PrivateKey key, java.lang.String digestAlg)
           
static com.novosec.pkix.asn1.cmp.PKIMessage protectPKIMessageWithPBE(com.novosec.pkix.asn1.cmp.PKIMessage msg, java.lang.String keyId, java.lang.String raSecret, java.lang.String digestAlgId, java.lang.String macAlgId, int iterationCount)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmpHelper

public CmpHelper()
Method Detail

createNonce

public static byte[] createNonce()
Returns:

createPKIHeader

public static com.novosec.pkix.asn1.cmp.PKIHeader createPKIHeader(org.bouncycastle.asn1.x509.X509Name sender,
                                                                  org.bouncycastle.asn1.x509.X509Name recipient)
Parameters:
sender -
recipient -
senderKID -
recipientKID -
senderNonce -
recipientNonce -
transactionId -
Returns:

parsePkiMessage

public static com.novosec.pkix.asn1.cmp.PKIMessage parsePkiMessage(byte[] message)
Parameters:
message -
Returns:

pkiMessageToByteArray

public static byte[] pkiMessageToByteArray(com.novosec.pkix.asn1.cmp.PKIMessage msg)
                                    throws java.io.IOException
Parameters:
msg -
Returns:
Throws:
java.io.IOException

protectPKIMessageWithCert

public static com.novosec.pkix.asn1.cmp.PKIMessage protectPKIMessageWithCert(com.novosec.pkix.asn1.cmp.PKIMessage msg,
                                                                             org.bouncycastle.asn1.x509.X509CertificateStructure cert,
                                                                             java.security.PrivateKey key,
                                                                             java.lang.String digestAlg)
                                                                      throws java.security.NoSuchProviderException,
                                                                             java.security.NoSuchAlgorithmException,
                                                                             java.lang.SecurityException,
                                                                             java.security.SignatureException,
                                                                             java.security.InvalidKeyException
Parameters:
msg -
cert -
key -
digestAlg -
Returns:
Throws:
java.security.NoSuchProviderException
java.security.NoSuchAlgorithmException
java.lang.SecurityException
java.security.SignatureException
java.security.InvalidKeyException

protectPKIMessageWithPBE

public static com.novosec.pkix.asn1.cmp.PKIMessage protectPKIMessageWithPBE(com.novosec.pkix.asn1.cmp.PKIMessage msg,
                                                                            java.lang.String keyId,
                                                                            java.lang.String raSecret,
                                                                            java.lang.String digestAlgId,
                                                                            java.lang.String macAlgId,
                                                                            int iterationCount)
                                                                     throws java.security.NoSuchAlgorithmException,
                                                                            java.security.NoSuchProviderException,
                                                                            java.security.InvalidKeyException,
                                                                            java.io.IOException
Parameters:
msg -
keyId -
raSecret -
digestAlgId -
macAlgId -
iterationCount -
Returns:
Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.InvalidKeyException
java.io.IOException