com.ibm.di.util
Class IDIpkcs7Crypto

java.lang.Object
  extended by com.ibm.di.util.IDIpkcs7Crypto

public class IDIpkcs7Crypto
extends Object


Constructor Summary
IDIpkcs7Crypto()
           
 
Method Summary
static RacfPassword getPasswordObject(byte[] pkcs7EnvelopeBytes, String receiverPath, String receiverKSpw, String receiverCertAlias, String receivercertPW, String signerPath, String signerKSpw, String signerCertAlias)
          Obtain object representing plain ascii text from a PKCS7 encoded, encrypted, signed password pkcs7 payload.
static RacfPassword getPasswordObject(com.ibm.security.pkcs7.ContentInfo contentInfo, String receiverPath, String receiverKSpw, String receiverCertAlias, String receivercertPW, String signerPath, String signerKSpw, String signerCertAlias)
          getPasswordObject: Obtain object representing plain ascii text from a PKCS7 encoded, encrypted, signed password pkcs7 payload.
static RacfPassword getPasswordObject(String pkcs7EnvelopePath, String receiverPath, String receiverKSpw, String receiverCertAlias, String receivercertPW, String signerPath, String signerKSpw, String signerCertAlias)
          Obtain object representing plain ascii text from a PKCS7 encoded, encrypted, signed password pkcs7 payload.
static void main(String[] args)
           
static boolean verifySignature(com.ibm.security.pkcs7.SignedData signeddata, Certificate signerCert)
          verifySignature
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IDIpkcs7Crypto

public IDIpkcs7Crypto()
Method Detail

main

public static void main(String[] args)

getPasswordObject

public static RacfPassword getPasswordObject(byte[] pkcs7EnvelopeBytes,
                                             String receiverPath,
                                             String receiverKSpw,
                                             String receiverCertAlias,
                                             String receivercertPW,
                                             String signerPath,
                                             String signerKSpw,
                                             String signerCertAlias)
                                      throws Exception
Obtain object representing plain ascii text from a PKCS7 encoded, encrypted, signed password pkcs7 payload. See RacfPassword class for details of decoded contents. Note: use this constructor when emveloped data is in a byte array.

Parameters:
pkcs7EnvelopeBytes - byte[] containing containing PKCS7 package to be decrypted
receiverPath - String representing file path to recipient JKS keystore file
receiverKSpw - String which is password to recipient keystore file
receiverCertAlias - String receiver certifcate alias name
receivercertPW - String which is password to recipient certificate
signerPath - String representing file path to signer JKS keystore file
signerKSpw - String which is password to signer keystore file
signerCertAlias - String signer certifcate alias name
Returns:
String representing the decrypted format of the received string. Null is returned when a null is received.
Throws:
java.langException - when underlying funtion fails
Exception

getPasswordObject

public static RacfPassword getPasswordObject(com.ibm.security.pkcs7.ContentInfo contentInfo,
                                             String receiverPath,
                                             String receiverKSpw,
                                             String receiverCertAlias,
                                             String receivercertPW,
                                             String signerPath,
                                             String signerKSpw,
                                             String signerCertAlias)
                                      throws Exception
getPasswordObject: Obtain object representing plain ascii text from a PKCS7 encoded, encrypted, signed password pkcs7 payload. See RacfPassword class for details of decoded contents. Note: use this constructor when eveloped data is contained in a ContentInfoObject

Parameters:
contentInfo - ContentInfo obejct representing envelope to be decrypted
receiverPath - String representing file path to recipient JKS keystore file
receiverKSpw - String which is password to recipient keystore file
receiverCertAlias - String receiver certifcate alias name
receivercertPW - String which is password to recipient certificate
signerPath - String representing file path to signer JKS keystore file
signerKSpw - String which is password to signer keystore file
signerCertAlias - String signer certifcate alias name
Returns:
String representing the decrypted format of the received string. Null is returned when a null is received.
Throws:
java.langException - when underlying funtion fails
Exception

getPasswordObject

public static RacfPassword getPasswordObject(String pkcs7EnvelopePath,
                                             String receiverPath,
                                             String receiverKSpw,
                                             String receiverCertAlias,
                                             String receivercertPW,
                                             String signerPath,
                                             String signerKSpw,
                                             String signerCertAlias)
                                      throws Exception
Obtain object representing plain ascii text from a PKCS7 encoded, encrypted, signed password pkcs7 payload. See RacfPassword class for details of decoded contents. Note: use this constructor when testing enveloped data contained in ascii files.

Parameters:
pkcs7EnvelopePath - String containing path to file containing PKCS7 package to be decrypted
receiverPath - String representing file path to recipient JKS keystore file
receiverKSpw - String which is password to recipient keystore file
receiverCertAlias - String receiver certifcate alias name
receivercertPW - String which is password to recipient certificate
signerPath - String representing file path to signer JKS keystore file
signerKSpw - String which is password to signer keystore file
signerCertAlias - String signer certifcate alias name
Returns:
String representing the decrypted format of the received string. Null is returned when a null is received.
Throws:
java.langException - when underlying funtion fails
Exception

verifySignature

public static boolean verifySignature(com.ibm.security.pkcs7.SignedData signeddata,
                                      Certificate signerCert)
                               throws Exception
verifySignature

Parameters:
signeddata - SignedData object from envelope
signerCert - X509Certificate from issuer/signer
Returns:
boolean true if success verifying signers signature
Throws:
Exception - when underlying function fails.