org.bouncycastle.crypto.engines
Class RFC3211WrapEngine

java.lang.Object
  extended by org.bouncycastle.crypto.engines.RFC3211WrapEngine
All Implemented Interfaces:
Wrapper

public class RFC3211WrapEngine
extends java.lang.Object
implements Wrapper

an implementation of the RFC 3211 Key Wrap Specification.


Field Summary
private  CBCBlockCipher engine
           
private  boolean forWrapping
           
private  ParametersWithIV param
           
private  java.security.SecureRandom rand
           
 
Constructor Summary
RFC3211WrapEngine(BlockCipher engine)
           
 
Method Summary
 java.lang.String getAlgorithmName()
          Return the name of the algorithm the wrapper implements.
 void init(boolean forWrapping, CipherParameters param)
           
 byte[] unwrap(byte[] in, int inOff, int inLen)
           
 byte[] wrap(byte[] in, int inOff, int inLen)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

engine

private CBCBlockCipher engine

param

private ParametersWithIV param

forWrapping

private boolean forWrapping

rand

private java.security.SecureRandom rand
Constructor Detail

RFC3211WrapEngine

public RFC3211WrapEngine(BlockCipher engine)
Method Detail

init

public void init(boolean forWrapping,
                 CipherParameters param)
Specified by:
init in interface Wrapper

getAlgorithmName

public java.lang.String getAlgorithmName()
Description copied from interface: Wrapper
Return the name of the algorithm the wrapper implements.

Specified by:
getAlgorithmName in interface Wrapper
Returns:
the name of the algorithm the wrapper implements.

wrap

public byte[] wrap(byte[] in,
                   int inOff,
                   int inLen)
Specified by:
wrap in interface Wrapper

unwrap

public byte[] unwrap(byte[] in,
                     int inOff,
                     int inLen)
              throws InvalidCipherTextException
Specified by:
unwrap in interface Wrapper
Throws:
InvalidCipherTextException