org.jpos.security
Class CryptographicServiceMessage

java.lang.Object
  extended by org.jpos.security.CryptographicServiceMessage
All Implemented Interfaces:
Loggeable

public class CryptographicServiceMessage
extends Object
implements 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).

Version:
$Revision$ $Date$
Author:
Hani S. Kirollos

Nested Class Summary
static class CryptographicServiceMessage.ParsingException
           
 
Field Summary
static String MCL_ESM
           
static String MCL_KSM
           
static String MCL_RSI
           
static String MCL_RSM
           
static String TAG_CTP
           
static String TAG_CTR
           
static String TAG_ERF
           
static String TAG_KD
           
static String TAG_ORG
           
static String TAG_RCV
           
static String TAG_SVR
           
 
Constructor Summary
CryptographicServiceMessage()
           
CryptographicServiceMessage(String mcl)
          Creates a CSM and sets its Message Class
 
Method Summary
 void addField(String tag, String content)
          adds a field to the CSM
 void dump(PrintStream p, String indent)
          dumps CSM basic information
 String getFieldContent(String tag)
          Returns the field content of a field with the given tag
 String getMCL()
           
static CryptographicServiceMessage parse(String csmString)
          Parses a csm string
 void setMCL(String mcl)
           
 String toString()
          Formats the CSM as a string, suitable for transfer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MCL_RSI

public static final String MCL_RSI
See Also:
Constant Field Values

MCL_KSM

public static final String MCL_KSM
See Also:
Constant Field Values

MCL_RSM

public static final String MCL_RSM
See Also:
Constant Field Values

MCL_ESM

public static final String MCL_ESM
See Also:
Constant Field Values

TAG_RCV

public static final String TAG_RCV
See Also:
Constant Field Values

TAG_ORG

public static final String TAG_ORG
See Also:
Constant Field Values

TAG_SVR

public static final String TAG_SVR
See Also:
Constant Field Values

TAG_KD

public static final String TAG_KD
See Also:
Constant Field Values

TAG_CTP

public static final String TAG_CTP
See Also:
Constant Field Values

TAG_CTR

public static final String TAG_CTR
See Also:
Constant Field Values

TAG_ERF

public static final String TAG_ERF
See Also:
Constant Field Values
Constructor Detail

CryptographicServiceMessage

public CryptographicServiceMessage()

CryptographicServiceMessage

public CryptographicServiceMessage(String mcl)
Creates a CSM and sets its Message Class

Parameters:
mcl - message class name. e.g. MCL_KSM, MCL_RSM...
Method Detail

setMCL

public void setMCL(String mcl)

getMCL

public String getMCL()

addField

public void addField(String tag,
                     String content)
adds a field to the CSM

Parameters:
tag - Field Tag
content - Field Content, can't be null, use an empty string ("") instead
Throws:
NullPointerException - if tag or content is null

getFieldContent

public String getFieldContent(String tag)
Returns the field content of a field with the given tag

Parameters:
tag -
Returns:
field Field Content, or null if tag not found

toString

public String toString()
Formats the CSM as a string, suitable for transfer. This is the inverse of parse

Overrides:
toString in class Object
Returns:
the CSM in string format

dump

public void dump(PrintStream p,
                 String indent)
dumps CSM basic information

Specified by:
dump in interface Loggeable
Parameters:
p - a PrintStream usually supplied by Logger
indent - indention string, usually suppiled by Logger
See Also:
Loggeable

parse

public static CryptographicServiceMessage parse(String csmString)
                                         throws CryptographicServiceMessage.ParsingException
Parses a csm string

Parameters:
csmString -
Returns:
CSM object
Throws:
CryptographicServiceMessage.ParsingException


Copyright © 1998-2012 jPOS.org. All Rights Reserved.