Class DESedeSecureMessagingWrapper

    • Field Detail

      • ZERO_IV_PARAM_SPEC

        public static final IvParameterSpec ZERO_IV_PARAM_SPEC
        Initialization vector consisting of 8 zero bytes.
    • Constructor Detail

      • DESedeSecureMessagingWrapper

        public DESedeSecureMessagingWrapper​(SecretKey ksEnc,
                                            SecretKey ksMac)
                                     throws GeneralSecurityException
        Constructs a secure messaging wrapper based on the secure messaging session keys. The initial value of the send sequence counter is set to 0L.
        Parameters:
        ksEnc - the session key for encryption
        ksMac - the session key for macs
        Throws:
        GeneralSecurityException - when the available JCE providers cannot provide the necessary cryptographic primitives ("DESede/CBC/Nopadding" Cipher, "ISO9797Alg3Mac" Mac).
      • DESedeSecureMessagingWrapper

        public DESedeSecureMessagingWrapper​(SecretKey ksEnc,
                                            SecretKey ksMac,
                                            boolean shouldCheckMAC)
                                     throws GeneralSecurityException
        Constructs a secure messaging wrapper based on the secure messaging session keys. The initial value of the send sequence counter is set to 0L.
        Parameters:
        ksEnc - the session key for encryption
        ksMac - the session key for macs
        shouldCheckMAC - a boolean indicating whether this wrapper will check the MAC in wrapped response APDUs
        Throws:
        GeneralSecurityException - when the available JCE providers cannot provide the necessary cryptographic primitives ("DESede/CBC/Nopadding" Cipher, "ISO9797Alg3Mac" Mac).
      • DESedeSecureMessagingWrapper

        public DESedeSecureMessagingWrapper​(SecretKey ksEnc,
                                            SecretKey ksMac,
                                            long ssc)
                                     throws GeneralSecurityException
        Constructs a secure messaging wrapper based on the secure messaging session keys and the initial value of the send sequence counter. Used in BAC and EAC 1.
        Parameters:
        ksEnc - the session key for encryption
        ksMac - the session key for macs
        ssc - the initial value of the send sequence counter
        Throws:
        GeneralSecurityException - when the available JCE providers cannot provide the necessary cryptographic primitives
      • DESedeSecureMessagingWrapper

        public DESedeSecureMessagingWrapper​(DESedeSecureMessagingWrapper wrapper)
                                     throws GeneralSecurityException
        Constructs a secure messaging wrapper based on the given existing secure messaging wrapper. This is a convenience copy constructor.
        Parameters:
        wrapper - an existing wrapper
        Throws:
        GeneralSecurityException - when the available JCE providers cannot provide the necessary cryptographic primitives
      • DESedeSecureMessagingWrapper

        public DESedeSecureMessagingWrapper​(SecretKey ksEnc,
                                            SecretKey ksMac,
                                            int maxTranceiveLength,
                                            boolean shouldCheckMAC,
                                            long ssc)
                                     throws GeneralSecurityException
        Constructs a secure messaging wrapper based on the secure messaging session keys and the initial value of the send sequence counter. Used in BAC and EAC 1.
        Parameters:
        ksEnc - the session key for encryption
        ksMac - the session key for macs
        maxTranceiveLength - the maximum tranceive length, typical values are 256 or 65536
        shouldCheckMAC - a boolean indicating whether this wrapper will check the MAC in wrapped response APDUs
        ssc - the initial value of the send sequence counter
        Throws:
        GeneralSecurityException - when the available JCE providers cannot provide the necessary cryptographic primitives