For the latest news and information visit
The GNU Crypto project

gnu.crypto.jce.cipher
Class PBES2

java.lang.Object
  extended byjavax.crypto.CipherSpi
      extended bygnu.crypto.jce.cipher.CipherAdapter
          extended bygnu.crypto.jce.cipher.PBES2
Direct Known Subclasses:
PBES2.HMacHaval, PBES2.HMacMD2, PBES2.HMacMD4, PBES2.HMacMD5, PBES2.HMacRipeMD128, PBES2.HMacRipeMD160, PBES2.HMacSHA1, PBES2.HMacSHA256, PBES2.HMacSHA384, PBES2.HMacSHA512, PBES2.HMacTiger, PBES2.HMacWhirlpool

public abstract class PBES2
extends CipherAdapter

.

Version:
$Revision: 1.2 $

Nested Class Summary
static class PBES2.HMacHaval
           
static class PBES2.HMacMD2
           
static class PBES2.HMacMD4
           
static class PBES2.HMacMD5
           
static class PBES2.HMacRipeMD128
           
static class PBES2.HMacRipeMD160
           
static class PBES2.HMacSHA1
           
static class PBES2.HMacSHA256
           
static class PBES2.HMacSHA384
           
static class PBES2.HMacSHA512
           
static class PBES2.HMacTiger
           
static class PBES2.HMacWhirlpool
           
 
Field Summary
protected  java.util.Map attributes
          Our attributes map.
protected  int blockLen
          The length of blocks we are processing.
protected  IBlockCipher cipher
          Our cipher instance.
protected  int keyLen
          The current key size.
protected  java.lang.String macName
          The HMac (PRF) algorithm name.
protected  IMode mode
          Our mode instance.
protected  IPad pad
          Our padding instance.
protected  byte[] partBlock
          An incomplete block.
protected  int partLen
          The number of bytes in CipherAdapter.partBlock.
 
Constructor Summary
protected PBES2(java.lang.String cipherName, int blockLen, java.lang.String macName)
           
protected PBES2(java.lang.String cipherName, java.lang.String macName)
           
 
Method Summary
protected  byte[] engineDoFinal(byte[] input, int off, int len)
           
protected  int engineDoFinal(byte[] in, int inOff, int inLen, byte[] out, int outOff)
           
protected  int engineGetBlockSize()
           
protected  byte[] engineGetIV()
           
protected  int engineGetOutputSize(int inputLen)
           
protected  java.security.AlgorithmParameters engineGetParameters()
           
protected  void engineInit(int opmode, java.security.Key key, java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)
           
protected  void engineInit(int opmode, java.security.Key key, java.security.AlgorithmParameters params, java.security.SecureRandom random)
           
protected  void engineInit(int opmode, java.security.Key key, java.security.SecureRandom random)
           
protected  void engineSetMode(java.lang.String modeName)
           
protected  void engineSetPadding(java.lang.String padName)
           
protected  byte[] engineUpdate(byte[] input, int off, int len)
           
protected  int engineUpdate(byte[] in, int inOff, int inLen, byte[] out, int outOff)
           
 
Methods inherited from class javax.crypto.CipherSpi
engineGetKeySize, engineUnwrap, engineWrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

macName

protected java.lang.String macName
The HMac (PRF) algorithm name.


cipher

protected IBlockCipher cipher
Our cipher instance.


mode

protected IMode mode
Our mode instance.


pad

protected IPad pad
Our padding instance.


keyLen

protected int keyLen
The current key size.


attributes

protected java.util.Map attributes
Our attributes map.


partBlock

protected byte[] partBlock
An incomplete block.


partLen

protected int partLen
The number of bytes in CipherAdapter.partBlock.


blockLen

protected int blockLen
The length of blocks we are processing.

Constructor Detail

PBES2

protected PBES2(java.lang.String cipherName,
                int blockLen,
                java.lang.String macName)

PBES2

protected PBES2(java.lang.String cipherName,
                java.lang.String macName)
Method Detail

engineInit

protected void engineInit(int opmode,
                          java.security.Key key,
                          java.security.SecureRandom random)
                   throws java.security.InvalidKeyException
Overrides:
engineInit in class CipherAdapter
Throws:
java.security.InvalidKeyException

engineInit

protected void engineInit(int opmode,
                          java.security.Key key,
                          java.security.spec.AlgorithmParameterSpec params,
                          java.security.SecureRandom random)
                   throws java.security.InvalidKeyException,
                          java.security.InvalidAlgorithmParameterException
Overrides:
engineInit in class CipherAdapter
Throws:
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException

engineInit

protected void engineInit(int opmode,
                          java.security.Key key,
                          java.security.AlgorithmParameters params,
                          java.security.SecureRandom random)
                   throws java.security.InvalidKeyException,
                          java.security.InvalidAlgorithmParameterException
Overrides:
engineInit in class CipherAdapter
Throws:
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException

engineSetMode

protected void engineSetMode(java.lang.String modeName)
                      throws java.security.NoSuchAlgorithmException
Throws:
java.security.NoSuchAlgorithmException

engineSetPadding

protected void engineSetPadding(java.lang.String padName)
                         throws javax.crypto.NoSuchPaddingException
Throws:
javax.crypto.NoSuchPaddingException

engineGetBlockSize

protected int engineGetBlockSize()

engineGetOutputSize

protected int engineGetOutputSize(int inputLen)

engineGetIV

protected byte[] engineGetIV()

engineGetParameters

protected java.security.AlgorithmParameters engineGetParameters()

engineUpdate

protected byte[] engineUpdate(byte[] input,
                              int off,
                              int len)

engineUpdate

protected int engineUpdate(byte[] in,
                           int inOff,
                           int inLen,
                           byte[] out,
                           int outOff)
                    throws javax.crypto.ShortBufferException
Throws:
javax.crypto.ShortBufferException

engineDoFinal

protected byte[] engineDoFinal(byte[] input,
                               int off,
                               int len)
                        throws javax.crypto.IllegalBlockSizeException,
                               javax.crypto.BadPaddingException
Throws:
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException

engineDoFinal

protected int engineDoFinal(byte[] in,
                            int inOff,
                            int inLen,
                            byte[] out,
                            int outOff)
                     throws javax.crypto.BadPaddingException,
                            javax.crypto.IllegalBlockSizeException,
                            javax.crypto.ShortBufferException
Throws:
javax.crypto.BadPaddingException
javax.crypto.IllegalBlockSizeException
javax.crypto.ShortBufferException

For the latest news and information visit
The GNU Crypto project

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.