Class HardTokenDataParser


  • public class HardTokenDataParser
    extends java.lang.Object
    Class to generate and parse Hard Token Data Structures. It has also methods to create encrypted binary data defined in the credential managment protocol 2.0 specification.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_VERSION  
      static java.lang.String NAMESPACE  
    • Constructor Summary

      Constructors 
      Constructor Description
      HardTokenDataParser​(MessageSecurityProvider securityProvider)
      Constructor for Hard Token Data Parser, this is the default method to create a parser, it should not be fetched by the PayloadParserRegistry since this is not a CSMessagePayload.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      HardTokenData decryptAndParse​(byte[] encryptedData)
      Method to decrypt and unmarshall a hard token data.
      byte[] encryptAndMarshall​(HardTokenData hardTokenData, java.util.List<java.security.cert.X509Certificate> receipients)
      Method to serialize and encrypt a hard token data to a given reciepient.
      HardTokenData genHardTokenData​(java.lang.String tokenType, java.lang.String tokenClass, java.lang.String serialNumber, boolean supportsRemoteUnblock, java.util.Date createTime, java.util.Date modifyTime, java.util.List<PINData> pins)
      Method to create a basic Hard Token Data without any key recovery functionality.
      byte[] marshall​(HardTokenData hardTokenData)
      Method to serialize a hard token data to a byte array.
      HardTokenData parse​(byte[] data)
      Method to parse a unencrypted hard token data.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NAMESPACE

        public static java.lang.String NAMESPACE
      • DEFAULT_VERSION

        public static java.lang.String DEFAULT_VERSION
    • Constructor Detail

      • HardTokenDataParser

        public HardTokenDataParser​(MessageSecurityProvider securityProvider)
                            throws MessageProcessingException
        Constructor for Hard Token Data Parser, this is the default method to create a parser, it should not be fetched by the PayloadParserRegistry since this is not a CSMessagePayload.
        Parameters:
        securityProvider - the security provider to use for encrypting and decrypting messages.
        Throws:
        MessageProcessingException - if internal problems occurred initializing the parser.
    • Method Detail

      • genHardTokenData

        public HardTokenData genHardTokenData​(java.lang.String tokenType,
                                              java.lang.String tokenClass,
                                              java.lang.String serialNumber,
                                              boolean supportsRemoteUnblock,
                                              java.util.Date createTime,
                                              java.util.Date modifyTime,
                                              java.util.List<PINData> pins)
                                       throws MessageProcessingException
        Method to create a basic Hard Token Data without any key recovery functionality.

        All parameters must be set.

        Parameters:
        tokenType - the token type of the token
        tokenClass - the token class, i.e ordinary. temporary etc.
        serialNumber - the serial number of the hard token
        supportsRemoteUnblock - if token supports remote unblock.
        createTime - the create time of the hard token data
        modifyTime - the modify time of the hard token data
        pins - a List of PinDatas to set, min size 1
        Returns:
        a newly generated hard token data.
        Throws:
        MessageProcessingException - if date convertion fails.
      • encryptAndMarshall

        public byte[] encryptAndMarshall​(HardTokenData hardTokenData,
                                         java.util.List<java.security.cert.X509Certificate> receipients)
                                  throws MessageContentException,
                                         MessageProcessingException
        Method to serialize and encrypt a hard token data to a given reciepient.

        The data will first be transformed into a encrypted data.

        Parameters:
        hardTokenData - the hard token data to serialize
        Returns:
        a serialized version of the hard token data.
        Throws:
        MessageContentException - if hard token data contained invalid content.
        MessageProcessingException - if internal problems occurred marshalling the data.