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

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


      SecretKey secretKey = Keys.getSecretKeyFromFile(keyBytes, KeyType.getKeyType(algorithm));
      SynchronousCrypter crypter = new SynchronousCrypter(secretKey);

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


      String beginText = String.format(CrypterIOHelper.BEGIN_SECRET_KEY_TEMPLATE, crypter.getAlgorithm());
      String endText = String.format(CrypterIOHelper.END_SECREY_KEY_TEMPLATE, crypter.getAlgorithm());

      CrypterIOHelper.writeKey(beginText, endText, keyBytes, outputStream);
    } catch (IOException e) {
      throw new CrypterException(e);
    }
  }
View Full Code Here

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

      }

      this.keyPairType = type;
      this.keyPair = generator.generateKeyPair();
    } catch (GeneralSecurityException e) {
      throw new CrypterException(e);
    }
  }
View Full Code Here

    try {
      Assert.notNull(data, "data");
      CrypterOperation operation = new CrypterOperation(privateKey, 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(publicKey, 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

        writer.writeObject(generator);
      }

      writer.close();
    } catch (IOException 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

      KeyPair keyPair = new KeyPair(publicKey, privateKey);
      AsynchronousCrypter crypter = new AsynchronousCrypter(keyPair);
      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.