Java 类org.apache.hadoop.hbase.io.crypto.CipherProvider 实例源码

项目:pbase    文件:AES.java   
public AES(CipherProvider provider) {
  super(provider);
  // The JCE mode for Ciphers
  cipherMode = provider.getConf().get(CIPHER_MODE_KEY, "AES/CTR/NoPadding");
  // The JCE provider, null if default
  cipherProvider = provider.getConf().get(CIPHER_PROVIDER_KEY);
  // RNG algorithm
  rngAlgorithm = provider.getConf().get(RNG_ALGORITHM_KEY, "SHA1PRNG");
  // RNG provider, null if default
  String rngProvider = provider.getConf().get(RNG_PROVIDER_KEY);
  try {
    if (rngProvider != null) {
      rng = SecureRandom.getInstance(rngAlgorithm, rngProvider);
    } else {
      rng = SecureRandom.getInstance(rngAlgorithm);
    }
  } catch (GeneralSecurityException e) {
    LOG.warn("Could not instantiate specified RNG, falling back to default", e);
    rng = new SecureRandom();
  }
}
项目:HIndex    文件:AES.java   
public AES(CipherProvider provider) {
  super(provider);
  // The JCE mode for Ciphers
  cipherMode = provider.getConf().get(CIPHER_MODE_KEY, "AES/CTR/NoPadding");
  // The JCE provider, null if default
  cipherProvider = provider.getConf().get(CIPHER_PROVIDER_KEY);
  // RNG algorithm
  rngAlgorithm = provider.getConf().get(RNG_ALGORITHM_KEY, "SHA1PRNG");
  // RNG provider, null if default
  String rngProvider = provider.getConf().get(RNG_PROVIDER_KEY);
  try {
    if (rngProvider != null) {
      rng = SecureRandom.getInstance(rngAlgorithm, rngProvider);
    } else {
      rng = SecureRandom.getInstance(rngAlgorithm);
    }
  } catch (GeneralSecurityException e) {
    LOG.warn("Could not instantiate specified RNG, falling back to default", e);
    rng = new SecureRandom();
  }
}
项目:hbase    文件:CommonsCryptoAES.java   
public CommonsCryptoAES(CipherProvider provider) {
  super(provider);
  // The mode for Commons Crypto Ciphers
  cipherMode = provider.getConf().get(CIPHER_MODE_KEY, "AES/CTR/NoPadding");
  // Reads Commons Crypto properties from HBase conf
  props = readCryptoProps(provider.getConf());
  // RNG algorithm
  rngAlgorithm = provider.getConf().get(RNG_ALGORITHM_KEY, "SHA1PRNG");
  // RNG provider, null if default
  String rngProvider = provider.getConf().get(RNG_PROVIDER_KEY);
  try {
    if (rngProvider != null) {
      rng = SecureRandom.getInstance(rngAlgorithm, rngProvider);
    } else {
      rng = SecureRandom.getInstance(rngAlgorithm);
    }
  } catch (GeneralSecurityException e) {
    LOG.warn("Could not instantiate specified RNG, falling back to default", e);
    rng = new SecureRandom();
  }
}
项目:hbase    文件:AES.java   
public AES(CipherProvider provider) {
  super(provider);
  // The JCE mode for Ciphers
  cipherMode = provider.getConf().get(CIPHER_MODE_KEY, "AES/CTR/NoPadding");
  // The JCE provider, null if default
  cipherProvider = provider.getConf().get(CIPHER_PROVIDER_KEY);
  // RNG algorithm
  rngAlgorithm = provider.getConf().get(RNG_ALGORITHM_KEY, "SHA1PRNG");
  // RNG provider, null if default
  String rngProvider = provider.getConf().get(RNG_PROVIDER_KEY);
  try {
    if (rngProvider != null) {
      rng = SecureRandom.getInstance(rngAlgorithm, rngProvider);
    } else {
      rng = SecureRandom.getInstance(rngAlgorithm);
    }
  } catch (GeneralSecurityException e) {
    LOG.warn("Could not instantiate specified RNG, falling back to default", e);
    rng = new SecureRandom();
  }
}
项目:PyroDB    文件:AES.java   
public AES(CipherProvider provider) {
  super(provider);
  // The JCE mode for Ciphers
  cipherMode = provider.getConf().get(CIPHER_MODE_KEY, "AES/CTR/NoPadding");
  // The JCE provider, null if default
  cipherProvider = provider.getConf().get(CIPHER_PROVIDER_KEY);
  // RNG algorithm
  rngAlgorithm = provider.getConf().get(RNG_ALGORITHM_KEY, "SHA1PRNG");
  // RNG provider, null if default
  String rngProvider = provider.getConf().get(RNG_PROVIDER_KEY);
  try {
    if (rngProvider != null) {
      rng = SecureRandom.getInstance(rngAlgorithm, rngProvider);
    } else {
      rng = SecureRandom.getInstance(rngAlgorithm);
    }
  } catch (GeneralSecurityException e) {
    LOG.warn("Could not instantiate specified RNG, falling back to default", e);
    rng = new SecureRandom();
  }
}