public class CryptographicServiceMessage extends java.lang.Object implements Loggeable
Modifier and Type | Class and Description |
---|---|
static class |
CryptographicServiceMessage.ParsingException |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MCL_ESM |
static java.lang.String |
MCL_KSM |
static java.lang.String |
MCL_RSI |
static java.lang.String |
MCL_RSM |
static java.lang.String |
TAG_CTP |
static java.lang.String |
TAG_CTR |
static java.lang.String |
TAG_ERF |
static java.lang.String |
TAG_KD |
static java.lang.String |
TAG_ORG |
static java.lang.String |
TAG_RCV |
static java.lang.String |
TAG_SVR |
Constructor and Description |
---|
CryptographicServiceMessage() |
CryptographicServiceMessage(java.lang.String mcl)
Creates a CSM and sets its Message Class
|
Modifier and Type | Method and Description |
---|---|
void |
addField(java.lang.String tag,
java.lang.String content)
adds a field to the CSM
|
void |
dump(java.io.PrintStream p,
java.lang.String indent)
dumps CSM basic information
|
java.lang.String |
getFieldContent(java.lang.String tag)
Returns the field content of a field with the given tag
|
java.lang.String |
getMCL() |
static CryptographicServiceMessage |
parse(java.lang.String csmString)
Parses a csm string
|
void |
removeField(java.lang.String tag)
Remove field from CSM
|
void |
removeFields(java.lang.String... tags)
Remove fields from CSM
|
void |
setMCL(java.lang.String mcl) |
java.lang.String |
toString()
Formats the CSM as a string, suitable for transfer.
|
public static final java.lang.String MCL_RSI
public static final java.lang.String MCL_KSM
public static final java.lang.String MCL_RSM
public static final java.lang.String MCL_ESM
public static final java.lang.String TAG_RCV
public static final java.lang.String TAG_ORG
public static final java.lang.String TAG_SVR
public static final java.lang.String TAG_KD
public static final java.lang.String TAG_CTP
public static final java.lang.String TAG_CTR
public static final java.lang.String TAG_ERF
public CryptographicServiceMessage()
public CryptographicServiceMessage(java.lang.String mcl)
mcl
- message class name. e.g. MCL_KSM, MCL_RSM...public void setMCL(java.lang.String mcl)
public java.lang.String getMCL()
public void addField(java.lang.String tag, java.lang.String content)
tag
- Field Tagcontent
- Field Content, can't be null, use an empty string ("") insteadjava.lang.NullPointerException
- if tag or content is nullpublic void removeField(java.lang.String tag)
tag
- Field Tagjava.lang.NullPointerException
- on null tagpublic void removeFields(java.lang.String... tags)
tags
- tag listjava.lang.NullPointerException
- on null tagpublic java.lang.String getFieldContent(java.lang.String tag)
tag
- public java.lang.String toString()
toString
in class java.lang.Object
public void dump(java.io.PrintStream p, java.lang.String indent)
public static CryptographicServiceMessage parse(java.lang.String csmString) throws CryptographicServiceMessage.ParsingException
csmString
- CryptographicServiceMessage.ParsingException