Package org.bouncycastle.crypto.engines
Class DESedeWrapEngine
- java.lang.Object
-
- org.bouncycastle.crypto.engines.DESedeWrapEngine
-
- All Implemented Interfaces:
Wrapper
public class DESedeWrapEngine extends Object implements Wrapper
Wrap keys according to draft-ietf-smime-key-wrap-01.txt.Note:
- this is based on a draft, and as such is subject to change - don't use this class for anything requiring long term storage.
- if you are using this to wrap triple-des keys you need to set the parity bits on the key and, if it's a two-key triple-des key, pad it yourself.
-
-
Constructor Summary
Constructors Constructor Description DESedeWrapEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAlgorithmName()Method getAlgorithmNamevoidinit(boolean forWrapping, CipherParameters param)Method initbyte[]unwrap(byte[] in, int inOff, int inLen)Method unwrapbyte[]wrap(byte[] in, int inOff, int inLen)Method wrap
-
-
-
Method Detail
-
init
public void init(boolean forWrapping, CipherParameters param)Method init
-
getAlgorithmName
public String getAlgorithmName()
Method getAlgorithmName- Specified by:
getAlgorithmNamein interfaceWrapper- Returns:
- the algorithm name "DESede".
-
wrap
public byte[] wrap(byte[] in, int inOff, int inLen)Method wrap
-
unwrap
public byte[] unwrap(byte[] in, int inOff, int inLen) throws InvalidCipherTextExceptionMethod unwrap- Specified by:
unwrapin interfaceWrapper- Parameters:
in- byte array containing the wrapped key.inOff- off set into in that the data starts at.inLen- length of the data.- Returns:
- the unwrapped bytes.
- Throws:
InvalidCipherTextException
-
-