Package br.net.woodstock.rockframework.security.crypt

Examples of br.net.woodstock.rockframework.security.crypt.CrypterException


    try {
      Assert.notNull(data, "data");
      CrypterOperation operation = new CrypterOperation(publicKey, Mode.DECRYPT, data, seed);
      return operation.execute();
    } catch (Exception e) {
      throw new CrypterException(e);
    }
  }
View Full Code Here


      }

      this.keyType = type;
      this.key = generator.generateKey();
    } catch (GeneralSecurityException e) {
      throw new CrypterException(e);
    }
  }
View Full Code Here

    try {
      Assert.notNull(data, "data");
      CrypterOperation operation = new CrypterOperation(this.key, Mode.ENCRYPT, data, seed);
      return operation.execute();
    } catch (Exception e) {
      throw new CrypterException(e);
    }
  }
View Full Code Here

    try {
      Assert.notNull(data, "data");
      CrypterOperation operation = new CrypterOperation(this.key, Mode.DECRYPT, data, seed);
      return operation.execute();
    } catch (Exception e) {
      throw new CrypterException(e);
    }
  }
View Full Code Here

      PublicKey publicKey = factory.generatePublic(specPublic);

      KeyPair keyPair = new KeyPair(publicKey, privateKey);
      return keyPair;
    } catch (Exception e) {
      throw new CrypterException(e);
    }
  }
View Full Code Here

        cipher.init(this.mode.getMode(), this.key);
      }
      byte[] result = cipher.doFinal(this.data);
      return result;
    } catch (GeneralSecurityException e) {
      throw new CrypterException(e);
    }
  }
View Full Code Here

    try {
      SecretKey key = this.crypter.getSecretKey();
      byte[] base64 = Base64Utils.toBase64(key.getEncoded());
      this.outputStream.write(base64);
    } catch (IOException e) {
      throw new CrypterException(e);
    }
  }
View Full Code Here

      XmlElement root = document.getRoot();
      root.addElement(CrypterIOHelper.KEY_ALGORITHM_ELEMENT).setData(crypter.getAlgorithm());
      CrypterIOHelper.addKey(root, CrypterIOHelper.SECRET_KEY_ELEMENT, key);
      document.write(outputStream);
    } catch (IOException e) {
      throw new CrypterException(e);
    }
  }
View Full Code Here

      KeyPair keyPair = new KeyPair(publicKey, privateKey);
      AsyncCrypter crypter = new AsyncCrypter(keyPair);
      return crypter;
    } catch (Exception e) {
      throw new CrypterException(e);
    }
  }
View Full Code Here

      SecretKeySpec keySpec = new SecretKeySpec(bytes, algorithm);
      SyncCrypter crypter = new SyncCrypter(keySpec);

      return crypter;
    } catch (Exception e) {
      throw new CrypterException(e);
    }
  }
View Full Code Here

TOP

Related Classes of br.net.woodstock.rockframework.security.crypt.CrypterException

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.