Package org.hdiv.cipher

Examples of org.hdiv.cipher.ICipherHTTP


      oos.writeObject(obj);
      oos.close();
      zos.close();
      baos.close();

      ICipherHTTP cipher = this.session.getEncryptCipher();
      // Get Key from session
      Key key = this.session.getCipherKey();
      byte[] cipherData;
      synchronized (cipher) {
        cipher.initEncryptMode(key);
        cipherData = cipher.encrypt(baos.toByteArray());
      }

      // Encodes an array of bytes into an array of URL safe 7-bit characters.
      // Unsafe characters are escaped.
      byte[] encodedData = URLCodec.encodeUrl(null, cipherData);
View Full Code Here


      // Decodes an array of URL safe 7-bit characters into an array of
      // original bytes. Escaped characters are converted back to their
      // original representation.
      byte[] encodedData = URLCodec.decodeUrl(encryptedData);

      ICipherHTTP cipher = this.session.getDecryptCipher();
      // Get Key from session
      Key key = this.session.getCipherKey();
      byte[] data;
      synchronized (cipher) {
        cipher.initDecryptMode(key);
        data = cipher.decrypt(encodedData);
      }

      ByteArrayInputStream decodedStream = new ByteArrayInputStream(data);
      InputStream unzippedStream = new GZIPInputStream(decodedStream);
      ObjectInputStream ois = new ObjectInputStream(unzippedStream);
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.hdiv.session.ISession#getEncryptCipher()
   */
  public ICipherHTTP getEncryptCipher() {
    ICipherHTTP cipher = this.beanFactory.getBean(ICipherHTTP.class);
    if (cipher == null) {
      String errorMessage = HDIVUtil.getMessage("encrypt.message");
      throw new HDIVException(errorMessage);
    }
    return cipher;
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.hdiv.session.ISession#getDecryptCipher()
   */
  public ICipherHTTP getDecryptCipher() {
    ICipherHTTP cipher = this.beanFactory.getBean(ICipherHTTP.class);
    if (cipher == null) {
      String errorMessage = HDIVUtil.getMessage("decrypt.message");
      throw new HDIVException(errorMessage);
    }
    return cipher;
View Full Code Here

TOP

Related Classes of org.hdiv.cipher.ICipherHTTP

Copyright © 2018 www.massapicom. 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.