|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.neociclo.odetteftp.util.EnvelopingUtil
public class EnvelopingUtil
Constructor Summary | |
---|---|
EnvelopingUtil()
|
Method Summary | |
---|---|
static void |
addNotifSignature(DefaultSignedDeliveryNotification notif,
CipherSuite cipherSuite,
X509Certificate userCert,
PrivateKey userPrivateKey)
|
static String |
asDigestAlgorithm(CipherSuite cs)
|
static String |
asEncryptionAlgorithm(CipherSuite cipherSuite)
|
static void |
createCompressedData(File data,
File output)
|
static void |
createCompressedData(InputStream dataStream,
OutputStream outStream)
|
static void |
createCompressedData(String dataPath,
String outputPath)
|
static byte[] |
createEnvelopedData(byte[] content,
CipherSuite cipherSel,
X509Certificate cert)
Generate an EnvelopedData object by encrypting the content using the partner's public certificate with the specified CipherSuite. |
static void |
createEnvelopedData(File data,
File output,
CipherSuite cipherSel,
X509Certificate cert)
|
static void |
createEnvelopedData(InputStream dataStream,
OutputStream outStream,
CipherSuite cipherSel,
X509Certificate cert)
|
static void |
createEnvelopedData(String dataPath,
String outputPath,
CipherSuite cipherSel,
X509Certificate cert)
|
static void |
createFileFromCompressedData(File compressedData,
File output)
|
static void |
createFileFromCompressedData(String compressedDataPath,
String outputPath)
|
static void |
createFileFromEnvelopedData(File envelopedData,
File output,
X509Certificate cert,
PrivateKey key)
|
static void |
createFileFromEnvelopedData(String envelopedDataPath,
String outputPath,
X509Certificate cert,
PrivateKey key)
|
static void |
createFileFromSignedData(File signedData,
File output,
X509Certificate cert)
|
static byte[] |
createSignedData(byte[] content,
CipherSuite cipherSuite,
X509Certificate cert,
PrivateKey key)
Generate a SignedData object using SHA-1 digest. |
static void |
createSignedData(File data,
File output,
CipherSuite cipherSuite,
X509Certificate cert,
PrivateKey key)
|
static void |
createSignedData(InputStream dataStream,
CipherSuite cipherSuite,
OutputStream outStream,
X509Certificate cert,
PrivateKey key)
|
static byte[] |
getNotifSigningData(SignedDeliveryNotification info)
Prepare the data buffer for signing from the acknowledge object. |
static InputStream |
openCompressedDataParser(InputStream compressedData)
|
static OutputStream |
openCompressedDataStreamGenerator(OutputStream outStream)
|
static InputStream |
openEnvelopedDataParser(InputStream cryptData,
X509Certificate cert,
PrivateKey key)
|
static OutputStream |
openEnvelopedDataStreamGenerator(OutputStream outStream,
CipherSuite cipherSel,
X509Certificate cert)
|
static InputStream |
openSignedDataParser(InputStream sigData,
X509Certificate checkCert)
|
static InputStream |
openSignedDataParser(InputStream sigData,
X509Certificate checkCert,
SignatureVerifyResult checkResult)
|
static OutputStream |
openSignedDataStreamGenerator(OutputStream outStream,
CipherSuite cipherSuite,
X509Certificate cert,
PrivateKey key)
|
static void |
parseCompressedDataContentStream(InputStream compressedData,
OutputStream outStream)
|
static byte[] |
parseEnvelopedData(byte[] encoded,
X509Certificate cert,
PrivateKey key)
Return null if certificate's recipientId could not be found within the encoded envelope - typically when using a bad certificate to decrypt the authentication challenge encrypted using other public certificate. |
static void |
parseEnvelopedDataContentStream(InputStream envelopedStream,
OutputStream outStream,
X509Certificate cert,
PrivateKey key)
|
static byte[] |
parseSignedData(byte[] encoded)
Retrieve the signed content from a SignedData object. |
static byte[] |
parseSignedData(byte[] encoded,
X509Certificate checkCert,
SignatureVerifyResult checkResult)
|
static void |
parseSignedDataContentStream(InputStream signedStream,
OutputStream outStream,
X509Certificate cert)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EnvelopingUtil()
Method Detail |
---|
public static byte[] createEnvelopedData(byte[] content, CipherSuite cipherSel, X509Certificate cert) throws NoSuchAlgorithmException, NoSuchProviderException, org.bouncycastle.cms.CMSException, IOException
content
- the data to be encryptedcipherSel
- ODETTE-FTP like cipher suite selectioncert
- partner's public certificate used to produce encrypted data
NoSuchAlgorithmException
NoSuchProviderException
org.bouncycastle.cms.CMSException
IOException
public static void createEnvelopedData(InputStream dataStream, OutputStream outStream, CipherSuite cipherSel, X509Certificate cert) throws NoSuchAlgorithmException, NoSuchProviderException, org.bouncycastle.cms.CMSException, IOException
NoSuchAlgorithmException
NoSuchProviderException
org.bouncycastle.cms.CMSException
IOException
public static OutputStream openEnvelopedDataStreamGenerator(OutputStream outStream, CipherSuite cipherSel, X509Certificate cert) throws NoSuchAlgorithmException, NoSuchProviderException, org.bouncycastle.cms.CMSException, IOException
NoSuchAlgorithmException
NoSuchProviderException
org.bouncycastle.cms.CMSException
IOException
public static InputStream openEnvelopedDataParser(InputStream cryptData, X509Certificate cert, PrivateKey key) throws org.bouncycastle.cms.CMSException, IOException, NoSuchProviderException
cryptData
- InputStream of encapsulated encrypted datacert
- user secure certificate used to match the recipient identifierkey
- user private key used to decrypt the encapsulated data
org.bouncycastle.cms.CMSException
IOException
NoSuchProviderException
public static InputStream openCompressedDataParser(InputStream compressedData) throws org.bouncycastle.cms.CMSException
compressedData
- InputStream of encapsulated compressed data
org.bouncycastle.cms.CMSException
public static InputStream openSignedDataParser(InputStream sigData, X509Certificate checkCert) throws org.bouncycastle.cms.CMSException
org.bouncycastle.cms.CMSException
public static InputStream openSignedDataParser(InputStream sigData, X509Certificate checkCert, SignatureVerifyResult checkResult) throws org.bouncycastle.cms.CMSException
org.bouncycastle.cms.CMSException
public static void createSignedData(File data, File output, CipherSuite cipherSuite, X509Certificate cert, PrivateKey key) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchProviderException, org.bouncycastle.cms.CMSException, IOException
InvalidKeyException
NoSuchAlgorithmException
NoSuchProviderException
org.bouncycastle.cms.CMSException
IOException
public static void createSignedData(InputStream dataStream, CipherSuite cipherSuite, OutputStream outStream, X509Certificate cert, PrivateKey key) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchProviderException, org.bouncycastle.cms.CMSException, IOException
InvalidKeyException
NoSuchAlgorithmException
NoSuchProviderException
org.bouncycastle.cms.CMSException
IOException
public static OutputStream openSignedDataStreamGenerator(OutputStream outStream, CipherSuite cipherSuite, X509Certificate cert, PrivateKey key) throws NoSuchAlgorithmException, NoSuchProviderException, org.bouncycastle.cms.CMSException, IOException, InvalidKeyException
NoSuchAlgorithmException
NoSuchProviderException
org.bouncycastle.cms.CMSException
IOException
InvalidKeyException
public static void createEnvelopedData(File data, File output, CipherSuite cipherSel, X509Certificate cert) throws NoSuchAlgorithmException, NoSuchProviderException, org.bouncycastle.cms.CMSException, IOException
NoSuchAlgorithmException
NoSuchProviderException
org.bouncycastle.cms.CMSException
IOException
public static void createEnvelopedData(String dataPath, String outputPath, CipherSuite cipherSel, X509Certificate cert) throws NoSuchAlgorithmException, NoSuchProviderException, org.bouncycastle.cms.CMSException, IOException
NoSuchAlgorithmException
NoSuchProviderException
org.bouncycastle.cms.CMSException
IOException
public static byte[] createSignedData(byte[] content, CipherSuite cipherSuite, X509Certificate cert, PrivateKey key) throws NoSuchAlgorithmException, NoSuchProviderException, org.bouncycastle.cms.CMSException, IOException
content
- the data to be signedcipherSuite
- cert
- private certificate used in conjunction with private keykey
- private key used to produce the signed-data object
NoSuchAlgorithmException
NoSuchProviderException
org.bouncycastle.cms.CMSException
IOException
public static byte[] parseEnvelopedData(byte[] encoded, X509Certificate cert, PrivateKey key) throws NoSuchProviderException, org.bouncycastle.cms.CMSException, IOException
encoded
- cert
- key
-
NoSuchProviderException
org.bouncycastle.cms.CMSException
IOException
public static void parseEnvelopedDataContentStream(InputStream envelopedStream, OutputStream outStream, X509Certificate cert, PrivateKey key) throws NoSuchProviderException, org.bouncycastle.cms.CMSException, IOException
NoSuchProviderException
org.bouncycastle.cms.CMSException
IOException
public static byte[] parseSignedData(byte[] encoded) throws org.bouncycastle.cms.CMSException
encoded
- the SignedData object
org.bouncycastle.cms.CMSException
public static byte[] parseSignedData(byte[] encoded, X509Certificate checkCert, SignatureVerifyResult checkResult) throws org.bouncycastle.cms.CMSException, IOException
org.bouncycastle.cms.CMSException
IOException
public static void parseSignedDataContentStream(InputStream signedStream, OutputStream outStream, X509Certificate cert) throws org.bouncycastle.cms.CMSException, IOException
org.bouncycastle.cms.CMSException
IOException
public static void createCompressedData(String dataPath, String outputPath) throws IOException
IOException
public static void createCompressedData(File data, File output) throws IOException
IOException
public static void createCompressedData(InputStream dataStream, OutputStream outStream) throws IOException
IOException
public static OutputStream openCompressedDataStreamGenerator(OutputStream outStream) throws IOException
IOException
public static void createFileFromCompressedData(String compressedDataPath, String outputPath) throws org.bouncycastle.cms.CMSException, IOException
org.bouncycastle.cms.CMSException
IOException
public static void createFileFromCompressedData(File compressedData, File output) throws org.bouncycastle.cms.CMSException, IOException
org.bouncycastle.cms.CMSException
IOException
public static void createFileFromEnvelopedData(String envelopedDataPath, String outputPath, X509Certificate cert, PrivateKey key) throws NoSuchProviderException, org.bouncycastle.cms.CMSException, IOException
NoSuchProviderException
org.bouncycastle.cms.CMSException
IOException
public static void createFileFromEnvelopedData(File envelopedData, File output, X509Certificate cert, PrivateKey key) throws NoSuchProviderException, org.bouncycastle.cms.CMSException, IOException
NoSuchProviderException
org.bouncycastle.cms.CMSException
IOException
public static void parseCompressedDataContentStream(InputStream compressedData, OutputStream outStream) throws org.bouncycastle.cms.CMSException, IOException
org.bouncycastle.cms.CMSException
IOException
public static void createFileFromSignedData(File signedData, File output, X509Certificate cert) throws org.bouncycastle.cms.CMSException, IOException
org.bouncycastle.cms.CMSException
IOException
public static void addNotifSignature(DefaultSignedDeliveryNotification notif, CipherSuite cipherSuite, X509Certificate userCert, PrivateKey userPrivateKey) throws NoSuchAlgorithmException, NoSuchProviderException, IOException, org.bouncycastle.cms.CMSException
NoSuchAlgorithmException
NoSuchProviderException
IOException
org.bouncycastle.cms.CMSException
public static byte[] getNotifSigningData(SignedDeliveryNotification info) throws UnsupportedEncodingException
info
-
UnsupportedEncodingException
public static String asEncryptionAlgorithm(CipherSuite cipherSuite)
public static String asDigestAlgorithm(CipherSuite cs)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |