|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.util.IDIpkcs7Crypto
public class IDIpkcs7Crypto
This class is used to decrypt a PKCS#7 SignedData object and obtain signed contents. The signature of the encrypted data is verified and the contents from the SignedData object are detached. Then the payload stream is DER decoded resulting in an object of type RacfCredential.
Main routine for testing takes following arguments:
Usage: IDIpkcs7Crypto
[-receivecertKeystore=receiverCertificateKeystoreFileName] [-receivecertKeystorePW=receiverCertificateKeystorePassword] [-receivecertAlias=receiverCertificateAlias] [-receivecertPW=receiverCertificatePassword] [-signercertKeystore=signerCertificateKeystoreFileName] [-signercertKeystorePW=signerCertificateKeystorePassword] [-signercertAlias=signerCertificateAlias] [-envelope=pkcs7EnvelopeFileName]
To obtain the decrypted password/passphrase payload (RacfCredential.java) object:
IDIpkcs7Crypto.getCredentialObject( ContentInfo contentInfo, String receiverKSPath, String receiverKSpw, String receiverCertAlias, String receivercertPW, String signerPath, String signerKSpw, String signerCertAlias) IDIpkcs7Crypto.getCredentialObject( String pkcs7EnvelopePath, String receiverKSPath, String receiverKSpw, String receiverCertAlias, String receivercertPW, String signerPath, String signerKSpw, String signerCertAlias)
RacfCredential
Constructor Summary | |
---|---|
IDIpkcs7Crypto()
|
Method Summary | |
---|---|
static RacfCredential |
getCredentialObject(byte[] pkcs7EnvelopeBytes,
String receiverPath,
String receiverKSpw,
String receiverCertAlias,
String receivercertPW,
String signerPath,
String signerKSpw,
String signerCertAlias)
This method obtains object representing plain ASCII text from a PKCS#7 encoded, encrypted and signed PKCS#7 payload. |
static RacfCredential |
getCredentialObject(com.ibm.security.pkcs7.ContentInfo contentInfo,
String receiverPath,
String receiverKSpw,
String receiverCertAlias,
String receivercertPW,
String signerPath,
String signerKSpw,
String signerCertAlias)
This method obtains object representing plain ASCII text from a PKCS#7 encoded, encrypted and signed pkcs7 payload. |
static RacfCredential |
getCredentialObject(String pkcs7EnvelopePath,
String receiverPath,
String receiverKSpw,
String receiverCertAlias,
String receivercertPW,
String signerPath,
String signerKSpw,
String signerCertAlias)
This method obtains a plain ASCII text from a PKCS#7 encoded, encrypted and signed PKCS#7 payload. |
static RacfPassword |
getPasswordObject(byte[] pkcs7EnvelopeBytes,
String receiverPath,
String receiverKSpw,
String receiverCertAlias,
String receivercertPW,
String signerPath,
String signerKSpw,
String signerCertAlias)
Deprecated. |
static RacfPassword |
getPasswordObject(com.ibm.security.pkcs7.ContentInfo contentInfo,
String receiverPath,
String receiverKSpw,
String receiverCertAlias,
String receivercertPW,
String signerPath,
String signerKSpw,
String signerCertAlias)
Deprecated. |
static RacfPassword |
getPasswordObject(String pkcs7EnvelopePath,
String receiverPath,
String receiverKSpw,
String receiverCertAlias,
String receivercertPW,
String signerPath,
String signerKSpw,
String signerCertAlias)
Deprecated. |
static void |
main(String[] args)
|
static boolean |
verifySignature(com.ibm.security.pkcs7.SignedData signeddata,
Certificate signerCert)
This method verifies the signature of the data from the envelope. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IDIpkcs7Crypto()
Method Detail |
---|
public static void main(String[] args)
public static RacfCredential getCredentialObject(byte[] pkcs7EnvelopeBytes, String receiverPath, String receiverKSpw, String receiverCertAlias, String receivercertPW, String signerPath, String signerKSpw, String signerCertAlias) throws Exception
pkcs7EnvelopeBytes
- byte[] containing PKCS#7 package to be decryptedreceiverPath
- String representing file path to recipient's JKS keystore filereceiverKSpw
- String representing the password to recipient's keystore filereceiverCertAlias
- String representing the recipient's certificate alias namereceivercertPW
- String representing the password to recipient's certificatesignerPath
- String representing file path to signer's JKS keystore filesignerKSpw
- String representing the password to signer's keystore filesignerCertAlias
- String representing the signer's certificate alias name
Null
is returned when a null
is
received.
Exception
- when underlying function fails@Deprecated public static RacfPassword getPasswordObject(byte[] pkcs7EnvelopeBytes, String receiverPath, String receiverKSpw, String receiverCertAlias, String receivercertPW, String signerPath, String signerKSpw, String signerCertAlias) throws Exception
getCredentialObject(ContentInfo, String, String, String, String, String, String, String)
pkcs7EnvelopeBytes
- receiverPath
- receiverKSpw
- receiverCertAlias
- receivercertPW
- signerPath
- signerKSpw
- signerCertAlias
-
Null
is returned when a null
is
received.
Exception
public static RacfCredential getCredentialObject(com.ibm.security.pkcs7.ContentInfo contentInfo, String receiverPath, String receiverKSpw, String receiverCertAlias, String receivercertPW, String signerPath, String signerKSpw, String signerCertAlias) throws Exception
contentInfo
- ContentInfo object representing envelope to be decryptedreceiverPath
- String representing file path to recipient's JKS keystore filereceiverKSpw
- String which is password to recipient's keystore filereceiverCertAlias
- String representing the recipient's certificate alias namereceivercertPW
- String representing the password to recipient's certificatesignerPath
- String representing file path to signer's JKS keystore filesignerKSpw
- String representing the password to signer's keystore filesignerCertAlias
- String representing the signer's certificate alias name
Null
is returned when a null
is
received.
Exception
- when underlying function fails@Deprecated 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
getCredentialObject(ContentInfo, String, String, String, String, String, String, String)
contentInfo
- receiverPath
- receiverKSpw
- receiverCertAlias
- receivercertPW
- signerPath
- signerKSpw
- signerCertAlias
-
Null
is returned when a null
is
received.
Exception
public static RacfCredential getCredentialObject(String pkcs7EnvelopePath, String receiverPath, String receiverKSpw, String receiverCertAlias, String receivercertPW, String signerPath, String signerKSpw, String signerCertAlias) throws Exception
pkcs7EnvelopePath
- String representing path to file containing PKCS#7 package to
be decryptedreceiverPath
- String representing file path to recipient's JKS keystore filereceiverKSpw
- String representing the password to recipient's keystore filereceiverCertAlias
- String representing the receiver's certificate alias namereceivercertPW
- String representing the password to recipient's certificatesignerPath
- String representing file path to signer's JKS keystore filesignerKSpw
- String representing the password to signer's keystore filesignerCertAlias
- String signer certificate alias name
Null
is returned when a null
is
received.
Exception
- when underlying function failsclass for details of decoded contents.
@Deprecated public static RacfPassword getPasswordObject(String pkcs7EnvelopePath, String receiverPath, String receiverKSpw, String receiverCertAlias, String receivercertPW, String signerPath, String signerKSpw, String signerCertAlias) throws Exception
getCredentialObject(String, String, String, String, String, String, String, String)
pkcs7EnvelopePath
- receiverPath
- receiverKSpw
- receiverCertAlias
- receivercertPW
- signerPath
- signerKSpw
- signerCertAlias
-
Null
is returned when a null
is
received.
Exception
public static boolean verifySignature(com.ibm.security.pkcs7.SignedData signeddata, Certificate signerCert) throws Exception
signeddata
- SignedData object from envelopesignerCert
- X509Certificate from issuer/signer
true
if success verifying signers signature;
false
otherwise.
Exception
- when underlying function fails.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |