public class CipherTransformer extends Object implements Transformer
Cipher
Modifier and Type | Field and Description |
---|---|
static int |
AES_KIND |
static String |
AES_NAME |
Constructor and Description |
---|
CipherTransformer(String cipherName,
int kind)
Constructor for CipherTransformer.
|
Modifier and Type | Method and Description |
---|---|
RTPSByteBuffer |
decode(Key key,
SecurePayload payload)
Decodes a given SecurePayload
|
SecurePayload |
encode(Key key,
RTPSByteBuffer bb)
Encodes RTPSByteBuffer into SecurePayload.
|
String |
getName()
Gets the name of this transformer.
|
int |
getTransformationKind()
Gets the transformation kind used by this transformer.
|
public static final int AES_KIND
public static final String AES_NAME
public CipherTransformer(String cipherName, int kind) throws NoSuchAlgorithmException, NoSuchPaddingException
cipherName
- Name of the transformationkind
- transformationKindNoSuchAlgorithmException
- on NoSuchAlgorithmExceptionNoSuchPaddingException
- on NoSuchPaddingExceptionpublic int getTransformationKind()
Transformer
getTransformationKind
in interface Transformer
public String getName()
Transformer
getName
in interface Transformer
public SecurePayload encode(Key key, RTPSByteBuffer bb) throws SecurityException
Transformer
encode
in interface Transformer
key
- Keybb
- RTPSByteBuffer RTPSByteBuffer to encode. Position should be placed at
the end of buffer.SecurityException
- on SecurityExceptionpublic RTPSByteBuffer decode(Key key, SecurePayload payload) throws SecurityException
Transformer
decode
in interface Transformer
key
- Keypayload
- Payload to decodeSecurityException
- on SecurityExceptionCopyright © 2016. All rights reserved.