|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jcetaglib.lib.Hybrid
Hybrid encryption & decryption routines for use with BouncyCastle JCE provider
Constructor Summary | |
Hybrid()
|
Method Summary | |
static void |
decryptAndVerify(java.io.InputStream is,
java.io.DataOutputStream daos,
java.security.PrivateKey privKey,
SignerCertificate signercert,
java.lang.String signame,
java.lang.String algorithm,
java.lang.String mode,
java.lang.String padding,
int bufferlength)
decrypt and verify inputstream signature (which must support mark/reset) |
static java.lang.StringBuffer |
decryptAndVerify(java.lang.StringBuffer text,
java.security.PrivateKey privKey,
SignerCertificate signercert,
java.lang.String signame,
java.lang.String algorithm,
java.lang.String mode,
java.lang.String padding)
decrypt and verify text signature |
static void |
decryptAndVerifyHMAC(java.io.InputStream is,
java.io.DataOutputStream daos,
java.security.PrivateKey privKey,
java.lang.String algorithm,
java.lang.String mode,
java.lang.String padding,
int bufferlength)
Decrypts and verifies an inputstream (which must support mark/reset) with HMAC |
static java.lang.StringBuffer |
decryptAndVerifyHMAC(java.lang.StringBuffer text,
java.security.PrivateKey privKey,
java.lang.String algorithm,
java.lang.String mode,
java.lang.String padding)
Decrypts and verifies text with HMAC |
static void |
decryptFileAndVerify(java.lang.String file,
java.lang.String newfile,
java.security.PrivateKey privKey,
SignerCertificate signercert,
java.lang.String signame,
java.lang.String algorithm,
java.lang.String mode,
java.lang.String padding)
|
static void |
decryptFileAndVerifyHMAC(java.lang.String file,
java.lang.String newfile,
java.security.PrivateKey privKey,
java.lang.String algorithm,
java.lang.String mode,
java.lang.String padding)
Decrypts and verifies file with HMAC |
static void |
encryptAndSign(java.io.InputStream is,
java.io.DataOutputStream daos,
java.security.PublicKey receiverKey,
java.security.PrivateKey signingKey,
java.security.cert.X509Certificate cert,
java.lang.String signame,
java.lang.String algorithm,
byte[] seed,
int strength,
java.lang.String mode,
java.lang.String padding,
int bufferlength)
Encrypt and sign any inputstream |
static java.lang.StringBuffer |
encryptAndSign(java.lang.StringBuffer text,
java.security.PublicKey receiverKey,
java.security.PrivateKey signingKey,
java.security.cert.X509Certificate cert,
java.lang.String signame,
java.lang.String algorithm,
byte[] seed,
int strength,
java.lang.String mode,
java.lang.String padding)
Encrypt and sign a text |
static void |
encryptFileAndSign(java.lang.String file,
java.lang.String newfile,
java.security.PublicKey receiverKey,
java.security.PrivateKey signingKey,
java.security.cert.X509Certificate cert,
java.lang.String signame,
java.lang.String algorithm,
byte[] seed,
int strength,
java.lang.String mode,
java.lang.String padding)
Encrypt and sign a file |
static void |
encryptFileWithHMAC(java.lang.String file,
java.lang.String newfile,
java.security.PublicKey receiverKey,
java.lang.String algorithm,
byte[] seed,
int strength,
java.lang.String mode,
java.lang.String padding)
Encrypts file with an HMAC |
static void |
encryptWithHMAC(java.io.InputStream is,
java.io.DataOutputStream daos,
java.security.PublicKey receiverKey,
java.lang.String algorithm,
byte[] seed,
int strength,
java.lang.String mode,
java.lang.String padding,
int bufferlength)
Encrypts any inputstream with an HMAC |
static java.lang.StringBuffer |
encryptWithHMAC(java.lang.StringBuffer text,
java.security.PublicKey receiverKey,
java.lang.String algorithm,
byte[] seed,
int strength,
java.lang.String mode,
java.lang.String padding)
Encrypts text with an HMAC |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Hybrid()
Method Detail |
public static java.lang.StringBuffer encryptWithHMAC(java.lang.StringBuffer text, java.security.PublicKey receiverKey, java.lang.String algorithm, byte[] seed, int strength, java.lang.String mode, java.lang.String padding) throws CryptoException
text
- text to encryptreceiverKey
- the receiver's public key for encrypting the symmetric keyalgorithm
- encryption algorithm (e.g. "Rijndael")seed
- seed for SecureRandom (optional)strength
- the keysize in bits (e.g. 128)mode
- encryption mode (e.g. "CBC")padding
- padding scheme (e.g."PKCS7Padding")
CryptoException
- encryption errorspublic static void encryptFileWithHMAC(java.lang.String file, java.lang.String newfile, java.security.PublicKey receiverKey, java.lang.String algorithm, byte[] seed, int strength, java.lang.String mode, java.lang.String padding) throws CryptoException, java.io.IOException
file
- file to encryptnewfile
- encrypted filereceiverKey
- the receiver's public key for encrypting the symmetric keyalgorithm
- encryption algorithm (e.g. "Rijndael")seed
- seed for SecureRandom (optional)strength
- the keysize in bits (e.g. 128)mode
- encryption mode (e.g. "CBC")padding
- padding scheme (e.g."PKCS7Padding")
CryptoException
- encryption errors
java.io.IOException
- I/O errorspublic static void encryptWithHMAC(java.io.InputStream is, java.io.DataOutputStream daos, java.security.PublicKey receiverKey, java.lang.String algorithm, byte[] seed, int strength, java.lang.String mode, java.lang.String padding, int bufferlength) throws CryptoException, java.io.IOException
is
- inputstream to encryptdaos
- outputstream to store the encrypted datareceiverKey
- the receiver's public key for encrypting the symmetric keyalgorithm
- encryption algorithm (e.g. "Rijndael")seed
- seed for SecureRandom (optional)strength
- the keysize in bits (e.g. 128)mode
- encryption mode (e.g. "CBC")padding
- padding scheme (e.g."PKCS7Padding")bufferlength
- buffer length in bytes
CryptoException
- encryption errors
java.io.IOException
- I/O errorspublic static java.lang.StringBuffer decryptAndVerifyHMAC(java.lang.StringBuffer text, java.security.PrivateKey privKey, java.lang.String algorithm, java.lang.String mode, java.lang.String padding) throws HeaderException, InvalidHMACException, CryptoException
text
- the text to decryptprivKey
- the receiver's private key for decryptionalgorithm
- encryption algorithm (e.g. "Rijndael")mode
- encryption mode (e.g. "CBC")padding
- padding scheme (e.g."PKCS7Padding")
HeaderException
- thrown when package header is broken
InvalidHMACException
- thrown when the HMAC code is invalid
CryptoException
- all encryption errorspublic static void decryptFileAndVerifyHMAC(java.lang.String file, java.lang.String newfile, java.security.PrivateKey privKey, java.lang.String algorithm, java.lang.String mode, java.lang.String padding) throws CryptoException, HeaderException, InvalidHMACException, java.io.IOException
file
- the file to decryptnewfile
- the decrypted fileprivKey
- the receiver's private key for decryptionalgorithm
- encryption algorithm (e.g. "Rijndael")mode
- encryption mode (e.g. "CBC")padding
- padding scheme (e.g."PKCS7Padding")
java.io.IOException
- I/O errors
HeaderException
- thrown when package header is broken
InvalidHMACException
- thrown when the HMAC code is invalid
CryptoException
- all encryption errorspublic static void decryptAndVerifyHMAC(java.io.InputStream is, java.io.DataOutputStream daos, java.security.PrivateKey privKey, java.lang.String algorithm, java.lang.String mode, java.lang.String padding, int bufferlength) throws java.io.IOException, HeaderException, InvalidHMACException, CryptoException
is
- inputstream to decrypt (NOTE: the inputstream must support mark/reset because it must be read three times)daos
- outputstream to store the decrypted dataprivKey
- the receiver's private key for decryptionalgorithm
- encryption algorithm (e.g. "Rijndael")mode
- encryption mode (e.g. "CBC")padding
- padding scheme (e.g."PKCS7Padding")bufferlength
- buffer length in bytes
java.io.IOException
- I/O errors
HeaderException
- thrown when package header is broken
InvalidHMACException
- thrown when the HMAC code is invalid
CryptoException
- all encryption errorspublic static java.lang.StringBuffer encryptAndSign(java.lang.StringBuffer text, java.security.PublicKey receiverKey, java.security.PrivateKey signingKey, java.security.cert.X509Certificate cert, java.lang.String signame, java.lang.String algorithm, byte[] seed, int strength, java.lang.String mode, java.lang.String padding) throws CryptoException
text
- the text to encrypt and signreceiverKey
- the public key of the receiversigningKey
- the private key of the signercert
- the signer's certificatesigname
- the signature's algorithm (e.g."MD5withRSA")algorithm
- encryption algorithm (e.g. "Rijndael")seed
- for SecureRandom (optional)strength
- the keysize in bits (e.g. 128)mode
- encryption mode (e.g. "CBC")padding
- padding scheme (e.g."PKCS7Padding")
CryptoException
- encryption errorspublic static void encryptFileAndSign(java.lang.String file, java.lang.String newfile, java.security.PublicKey receiverKey, java.security.PrivateKey signingKey, java.security.cert.X509Certificate cert, java.lang.String signame, java.lang.String algorithm, byte[] seed, int strength, java.lang.String mode, java.lang.String padding) throws CryptoException, java.io.IOException
file
- file to encryptnewfile
- encrypted filereceiverKey
- the public key of the receiversigningKey
- the private key of the signercert
- the signer's certificatesigname
- the signature's algorithm (e.g."MD5withRSA")algorithm
- encryption algorithm (e.g. "Rijndael")seed
- for SecureRandom (optional)strength
- the keysize in bits (e.g. 128)mode
- encryption mode (e.g. "CBC")padding
- padding scheme (e.g."PKCS7Padding")
CryptoException
- encryption errors
java.io.IOException
- I/O errorspublic static void encryptAndSign(java.io.InputStream is, java.io.DataOutputStream daos, java.security.PublicKey receiverKey, java.security.PrivateKey signingKey, java.security.cert.X509Certificate cert, java.lang.String signame, java.lang.String algorithm, byte[] seed, int strength, java.lang.String mode, java.lang.String padding, int bufferlength) throws CryptoException, java.io.IOException
is
- inputstream to encryptdaos
- outputstream to store the encrypted & signed datareceiverKey
- the public key of the receiversigningKey
- the private key of the signercert
- the signer's certificatesigname
- the signature's algorithm (e.g."MD5withRSA")algorithm
- encryption algorithm (e.g. "Rijndael")seed
- for SecureRandom (optional)strength
- the keysize in bits (e.g. 128)mode
- encryption mode (e.g. "CBC")padding
- padding scheme (e.g."PKCS7Padding")bufferlength
- buffer length in bytes
CryptoException
- encryption errors
java.io.IOException
- I/O errorspublic static java.lang.StringBuffer decryptAndVerify(java.lang.StringBuffer text, java.security.PrivateKey privKey, SignerCertificate signercert, java.lang.String signame, java.lang.String algorithm, java.lang.String mode, java.lang.String padding) throws HeaderException, InvalidSignatureException, CryptoException
text
- the text to decrypt and verifyprivKey
- the private key of the receiversignercert
- returns the signer's certificatesigname
- the signature's algorithm (e.g."MD5withRSA")algorithm
- encryption algorithm (e.g. "Rijndael")mode
- encryption mode (e.g. "CBC")padding
- padding scheme (e.g."PKCS7Padding")
HeaderException
- thrown when package header is broken
InvalidSignatureException
- thrown when the signature is invalid
CryptoException
- all encryption errorspublic static void decryptAndVerify(java.io.InputStream is, java.io.DataOutputStream daos, java.security.PrivateKey privKey, SignerCertificate signercert, java.lang.String signame, java.lang.String algorithm, java.lang.String mode, java.lang.String padding, int bufferlength) throws CryptoException, HeaderException, InvalidSignatureException, java.io.IOException
is
- the inputstream to decrypt and verify (NOTE: the inputstream must support mark/reset because it must be read three times)daos
- the outputstream containing the deciphered dataprivKey
- the private key of the receiversignercert
- returns the signer's certificatesigname
- the signature's algorithm (e.g."MD5withRSA")algorithm
- encryption algorithm (e.g. "Rijndael")mode
- encryption mode (e.g. "CBC")padding
- padding scheme (e.g."PKCS7Padding")bufferlength
- buffer length in bytes
java.io.IOException
- I/O errors
HeaderException
- thrown when package header is broken
InvalidSignatureException
- thrown when the signature is invalid
CryptoException
- all encryption errorspublic static void decryptFileAndVerify(java.lang.String file, java.lang.String newfile, java.security.PrivateKey privKey, SignerCertificate signercert, java.lang.String signame, java.lang.String algorithm, java.lang.String mode, java.lang.String padding) throws CryptoException, HeaderException, InvalidSignatureException, java.io.IOException
file
- the file to decrypt and verifynewfile
- the decrypted fileprivKey
- the private key of the receiversignercert
- returns the signer's certificatesigname
- the signature's algorithm (e.g."MD5withRSA")algorithm
- encryption algorithm (e.g. "Rijndael")mode
- encryption mode (e.g. "CBC")padding
- padding scheme (e.g."PKCS7Padding")
java.io.IOException
- I/O errors
HeaderException
- thrown when package header is broken
InvalidSignatureException
- thrown when the signature is invalid
CryptoException
- all encryption errors
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |