Top Description Fields Constructors Methods
org.bouncycastle.crypto.engines

public Class RFC3394WrapEngine

extends Object
implements Wrapper
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.Wrapper
Known Direct Subclasses
org.bouncycastle.crypto.engines.SEEDWrapEngine, org.bouncycastle.crypto.engines.AESWrapEngine, org.bouncycastle.crypto.engines.ARIAWrapEngine, org.bouncycastle.crypto.engines.CamelliaWrapEngine
Imports
org.bouncycastle.crypto.BlockCipher, .CipherParameters, .DataLengthException, .InvalidCipherTextException, .Wrapper, org.bouncycastle.crypto.params.KeyParameter, .ParametersWithIV, .ParametersWithRandom, org.bouncycastle.util.Arrays

an implementation of the AES Key Wrapper from the NIST Key Wrap Specification as described in RFC 3394.

For further details see: https://www.ietf.org/rfc/rfc3394.txt and https://csrc.nist.gov/encryption/kms/key-wrap.pdf.

Field Summary

Modifier and TypeField and Description
private static final byte[]
private final BlockCipher
private boolean
private final byte[]
private KeyParameter
private final boolean

Constructor Summary

AccessConstructor and Description
public
RFC3394WrapEngine(BlockCipher
the block cipher to be used for wrapping.
engine
)

Create a RFC 3394 WrapEngine specifying the encrypt for wrapping, decrypt for unwrapping.

public
RFC3394WrapEngine(BlockCipher
the block cipher to be used for wrapping.
engine
,
boolean
true if engine should be used in decryption mode for wrapping, false otherwise.
useReverseDirection
)

Create a RFC 3394 WrapEngine specifying the direction for wrapping and unwrapping..

Method Summary

Modifier and TypeMethod and Description
public String
getAlgorithmName()

Implements org.bouncycastle.crypto.Wrapper.getAlgorithmName.

Return the name of the algorithm the wrapper implements.

public void
init(boolean forWrapping, CipherParameters param)

Implements org.bouncycastle.crypto.Wrapper.init.

public byte[]
unwrap(byte[] in, int inOff, int inLen)

Implements org.bouncycastle.crypto.Wrapper.unwrap.

public byte[]
wrap(byte[] in, int inOff, int inLen)

Implements org.bouncycastle.crypto.Wrapper.wrap.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_IVback to summary
private static final byte[] DEFAULT_IV
engineback to summary
private final BlockCipher engine
forWrappingback to summary
private boolean forWrapping
ivback to summary
private final byte[] iv
paramback to summary
private KeyParameter param
wrapCipherModeback to summary
private final boolean wrapCipherMode

Constructor Detail

RFC3394WrapEngineback to summary
public RFC3394WrapEngine(BlockCipher engine)

Create a RFC 3394 WrapEngine specifying the encrypt for wrapping, decrypt for unwrapping.

Parameters
engine:BlockCipher

the block cipher to be used for wrapping.

RFC3394WrapEngineback to summary
public RFC3394WrapEngine(BlockCipher engine, boolean useReverseDirection)

Create a RFC 3394 WrapEngine specifying the direction for wrapping and unwrapping..

Parameters
engine:BlockCipher

the block cipher to be used for wrapping.

useReverseDirection:boolean

true if engine should be used in decryption mode for wrapping, false otherwise.

Method Detail

getAlgorithmNameback to summary
public String getAlgorithmName()

Implements org.bouncycastle.crypto.Wrapper.getAlgorithmName.

Doc from org.bouncycastle.crypto.Wrapper.getAlgorithmName.

Return the name of the algorithm the wrapper implements.

Returns:String

the name of the algorithm the wrapper implements.

initback to summary
public void init(boolean forWrapping, CipherParameters param)

Implements org.bouncycastle.crypto.Wrapper.init.

unwrapback to summary
public byte[] unwrap(byte[] in, int inOff, int inLen) throws InvalidCipherTextException

Implements org.bouncycastle.crypto.Wrapper.unwrap.

wrapback to summary
public byte[] wrap(byte[] in, int inOff, int inLen)

Implements org.bouncycastle.crypto.Wrapper.wrap.