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
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
-
Constructor Details
-
DESedeWrapEngine
public DESedeWrapEngine()
-
-
Method Details
-
init
Method init -
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
Method unwrap- Specified by:
unwrapin interfaceWrapper- Parameters:
in-inOff-inLen-- Returns:
- the unwrapped bytes.
- Throws:
InvalidCipherTextException
-