• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java BlockCipherParameterSpec类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中gnu.javax.crypto.jce.spec.BlockCipherParameterSpec的典型用法代码示例。如果您正苦于以下问题:Java BlockCipherParameterSpec类的具体用法?Java BlockCipherParameterSpec怎么用?Java BlockCipherParameterSpec使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

BlockCipherParameterSpec类属于gnu.javax.crypto.jce.spec包,在下文中一共展示了BlockCipherParameterSpec类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: engineInit

点赞 3

import gnu.javax.crypto.jce.spec.BlockCipherParameterSpec; //导入依赖的package包/类
protected void engineInit(int opmode, Key key, AlgorithmParameters params,
                          SecureRandom random)
    throws InvalidAlgorithmParameterException, InvalidKeyException
{
  AlgorithmParameterSpec spec = null;
  try
    {
      if (params != null)
        spec = params.getParameterSpec(BlockCipherParameterSpec.class);
    }
  catch (InvalidParameterSpecException x)
    {
      if (Configuration.DEBUG)
        log.fine("Unable to translate algorithm parameters into an instance "
                 + "of BlockCipherParameterSpec. Discard");
    }
  engineInit(opmode, key, spec, random);
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:19,
代码来源:KeyWrappingAlgorithmAdapter.java

示例2: engineGetParameters

点赞 3

import gnu.javax.crypto.jce.spec.BlockCipherParameterSpec; //导入依赖的package包/类
protected AlgorithmParameters engineGetParameters()
{
  byte[] iv = (byte[]) attributes.get(IMode.IV);
  int cipherBlockSize = cipher.currentBlockSize();
  BlockCipherParameterSpec spec = new BlockCipherParameterSpec(iv,
                                                               cipherBlockSize,
                                                               keyLen);
  AlgorithmParameters params;
  try
    {
      params = AlgorithmParameters.getInstance("BlockCipherParameters");
      params.init(spec);
    }
  catch (NoSuchAlgorithmException nsae)
    {
      return null;
    }
  catch (InvalidParameterSpecException ipse)
    {
      return null;
    }
  return params;
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:24,
代码来源:CipherAdapter.java

示例3: engineInit

点赞 2

import gnu.javax.crypto.jce.spec.BlockCipherParameterSpec; //导入依赖的package包/类
protected void engineInit(int opmode, Key key, AlgorithmParameterSpec params,
                          SecureRandom random) throws InvalidKeyException,
    InvalidAlgorithmParameterException
{
  if (params instanceof BlockCipherParameterSpec)
    {
      if (((BlockCipherParameterSpec) params).getBlockSize() != 16)
        throw new InvalidAlgorithmParameterException(
            "AES block size must be 16 bytes");
    }
  super.engineInit(opmode, key, params, random);
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:13,
代码来源:AESSpi.java

示例4: engineInit

点赞 2

import gnu.javax.crypto.jce.spec.BlockCipherParameterSpec; //导入依赖的package包/类
protected void engineInit(int opmode, Key key, AlgorithmParameters params,
                          SecureRandom random) throws InvalidKeyException,
    InvalidAlgorithmParameterException
{
  AlgorithmParameterSpec spec = null;
  try
    {
      if (params != null)
        spec = params.getParameterSpec(BlockCipherParameterSpec.class);
    }
  catch (InvalidParameterSpecException ignored)
    {
    }
  engineInit(opmode, key, spec, random);
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:16,
代码来源:CipherAdapter.java

示例5: engineInit

点赞 2

import gnu.javax.crypto.jce.spec.BlockCipherParameterSpec; //导入依赖的package包/类
protected void engineInit(AlgorithmParameterSpec spec)
    throws InvalidParameterSpecException
{
  if (spec instanceof BlockCipherParameterSpec)
    cipherSpec = (BlockCipherParameterSpec) spec;
  else
    throw new InvalidParameterSpecException();
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:9,
代码来源:BlockCipherParameters.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)