Examples of CryptoException


Examples of org.bouncycastle.crypto.CryptoException

                    SecretKeyFactory factory = SecretKeyFactory.getInstance(PBE_ALGORITHM, PROVIDER);
                    SecretKey tmp = factory.generateSecret(pbeKeySpec);
                    SecretKey secret = new SecretKeySpec(tmp.getEncoded(), SECRET_KEY_ALGORITHM);
                    return secret;
            } catch (Exception e) {
                    throw new CryptoException(e.getMessage());
            }
    }
View Full Code Here

Examples of org.bouncycastle.crypto.CryptoException

                    byte[] salt = new byte[SALT_LENGTH];
                    random.nextBytes(salt);
                    String saltHex = bytesToHex(salt);
                    return saltHex;
            } catch (Exception e) {
              throw new CryptoException(e.getMessage());
            }
    }
View Full Code Here

Examples of org.bouncycastle.crypto.CryptoException

                  String encryptedHex = bytesToHex(encryptedText);
 
                  return ivHex + encryptedHex;
 
          } catch (Exception e) {
                  throw new CryptoException("Unable to encrypt");
          }
    }
View Full Code Here

Examples of org.bouncycastle.crypto.CryptoException

                    decryptionCipher.init(Cipher.DECRYPT_MODE, secret, ivspec);
                    byte[] decryptedText = decryptionCipher.doFinal(hexToBytes(encryptedHex));
                    String decrypted = new String(decryptedText, "UTF-8");
                    return decrypted;
            } catch (Exception e) {
                    throw new CryptoException("Unable to decrypt");
            }
    }
View Full Code Here

Examples of org.cfcc.CryptoException

        String encrypted = null;
        try {
            byte[] ciphertext = OpenSSL.encrypt(ALGORITHM, default_key.toCharArray(), text_in.getBytes());
            encrypted = Crypto.prefix() + new String(ciphertext);
        } catch (IOException ex) {
            throw new CryptoException(ex.toString());
        } catch (GeneralSecurityException ex) {
            throw new CryptoException(ex.toString());
        }
        return encrypted;
    }
View Full Code Here

Examples of org.cfcc.CryptoException

                without_prefix = encrypted_data;
            }
            byte[] cleartext = OpenSSL.decrypt(ALGORITHM, default_key.toCharArray(), without_prefix.getBytes());
            return new String(cleartext);
        } catch (IOException ex) {
            throw new CryptoException(ex.toString());
        } catch (GeneralSecurityException ex) {
            throw new CryptoException(ex.toString());
        }
    }
View Full Code Here

Examples of org.jitterbit.crypto.CryptoException

                    }
                }
            }
            return toLongArray(keyIDs);
        } catch (PGPException ex) {
            throw new CryptoException(ex.getMessage(), ex);
        } finally {
            KongaIoUtils.close(decoderStream);
        }
    }
View Full Code Here

Examples of org.jitterbit.crypto.CryptoException

            OutputStream cOut = cPk.open(encOut, bytes.length);
            cOut.write(bytes); // obtain the actual bytes from the compressed stream
            cOut.close();
            return encOut.toByteArray();
        } catch (NoSuchProviderException ex) {
            throw new CryptoException(ex.getMessage(), ex);
        } catch (PGPException ex) {
            throw new CryptoException(ex.getMessage(), ex);
        }
    }
View Full Code Here

Examples of org.jitterbit.crypto.CryptoException

            try {
                PGPPBEEncryptedData pbe = extractEncryptedData(encrypted);
                PGPLiteralData ld = extractLiteralData(pbe, passPhrase);
                return decryptLiteralData(ld);
            } catch (NoSuchProviderException ex) {
                throw new CryptoException(ex.getMessage(), ex);
            } catch (PGPException ex) {
                throw new CryptoException(ex.getMessage(), ex);
            }
        }
View Full Code Here

Examples of org.jitterbit.crypto.CryptoException

        public final byte[] run(byte[] input) throws CryptoException {
            try {
                prepareProcessor(processor);
                return processBytes(processor, input);
            } catch (Exception ex) {
                throw new CryptoException(ex);
            } finally {
                processor.close();
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.