Package org.hdiv.cipher

Examples of org.hdiv.cipher.Key


      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());
      }
View Full Code Here


      // 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);
      }
View Full Code Here

  protected void initStrategies(ApplicationContext context, HttpSession httpSession) {

    if (this.config.getStrategy().equals(Strategy.CIPHER)) {
      IKeyFactory keyFactory = context.getBean(IKeyFactory.class);
      // creating encryption key
      Key key = keyFactory.generateKey();
      httpSession.setAttribute(Constants.KEY_NAME, key);

    }
  }
View Full Code Here

   *
   * @see org.hdiv.session.ISession#getCipherKey()
   */
  public Key getCipherKey() {

    Key key = (Key) getHttpSession().getAttribute(this.keyName);
    if (key == null) {
      throw new HDIVException("Key not initialized on session");
    }
    return key;
  }
View Full Code Here

TOP

Related Classes of org.hdiv.cipher.Key

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.