Class CryptographicServiceMessage
java.lang.Object
org.jpos.security.CryptographicServiceMessage
- All Implemented Interfaces:
Loggeable
Cryptographic Service Message (CSM for short).
A message for transporting keys or
related information used to control a keying relationship.
It is typically the contents of ISOField(123).
For more information refer to ANSI X9.17: Financial Institution Key Mangement
(Wholesale).
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a CSM and sets its Message Class -
Method Summary
Modifier and TypeMethodDescriptionvoidadds a field to the CSMvoiddump(PrintStream p, String indent) dumps CSM basic informationgetFieldContent(String tag) Returns the field content of a field with the given taggetMCL()static CryptographicServiceMessageParses a csm stringvoidremoveField(String tag) Remove field from CSMvoidremoveFields(String... tags) Remove fields from CSMvoidtoString()Formats the CSM as a string, suitable for transfer.
-
Field Details
-
MCL_RSI
-
MCL_KSM
-
MCL_RSM
-
MCL_ESM
-
TAG_RCV
-
TAG_ORG
-
TAG_SVR
-
TAG_KD
-
TAG_CTP
-
TAG_CTR
-
TAG_ERF
-
-
Constructor Details
-
CryptographicServiceMessage
public CryptographicServiceMessage() -
CryptographicServiceMessage
Creates a CSM and sets its Message Class- Parameters:
mcl- message class name. e.g. MCL_KSM, MCL_RSM...
-
-
Method Details
-
setMCL
-
getMCL
-
addField
adds a field to the CSM- Parameters:
tag- Field Tagcontent- Field Content, can't be null, use an empty string ("") instead- Throws:
NullPointerException- if tag or content is null
-
removeField
Remove field from CSM- Parameters:
tag- Field Tag- Throws:
NullPointerException- on null tag
-
removeFields
Remove fields from CSM- Parameters:
tags- tag list- Throws:
NullPointerException- on null tag
-
getFieldContent
Returns the field content of a field with the given tag- Parameters:
tag-- Returns:
- field Field Content, or null if tag not found
-
toString
-
dump
dumps CSM basic information -
parse
public static CryptographicServiceMessage parse(String csmString) throws CryptographicServiceMessage.ParsingException Parses a csm string- Parameters:
csmString-- Returns:
- CSM object
- Throws:
CryptographicServiceMessage.ParsingException
-