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

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


      }

      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

        String endText = String.format(CrypterIOHelper.END_PUBLIC_KEY_TEMPLATE, crypter.getAlgorithm());

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

    try {
      byte[] bytes = this.crypter.getKey().getEncoded();
      byte[] base64 = Base64Utils.toBase64(bytes);
      this.outputStream.write(base64);
    } 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, this.type.getAlgorithm());
      SyncCrypter crypter = new SyncCrypter(keySpec);
     
      return crypter;
    } catch (IOException e) {
      throw new CrypterException(e);
    }
  }
View Full Code Here

        this.publicKeyOutputStream.write(base64);
      } else {
        CoreLog.getInstance().getLog().info("Public or publicKeyOutputStream is null and cold not be writed");
      }
    } catch (IOException e) {
      throw new CrypterException(e);
    }
  }
View Full Code Here

        generator.initialize(AsyncCrypter.DEFAULT_KEY_SIZE, random);
      }

      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);
      return operation.execute();
    } 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.