com.datecs.crypto

## Class DUKPT

- java.lang.Object
- - com.datecs.crypto.DUKPT

-     public final class DUKPT
      extends java.lang.Object

  Helper methods for DUKPT key generation.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DUKPT.DerivationPurpose` Identifies if this derivation is to create an initial key or any other key type to help select which derivation data table to use.
    `static class` | `DUKPT.KeyType` KeyType defines the cryptographic key type being derived.
    `static class` | `DUKPT.KeyUsage` KeyUsage defines the possible key usages that can be derived.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DUKPT()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static byte[]` | `createDerivationData(DUKPT.DerivationPurpose derivationPurpose, DUKPT.KeyUsage keyUsage, DUKPT.KeyType derivedKeyType, byte[] initialKeyID, int counter)`
    `static byte[]` | `deriveDataKey(byte[] ksn, byte[] ipek)`
    `static byte[]` | `deriveInitialKey(byte[] BDK, DUKPT.KeyType keyType, byte[] initialKeyID)`
    `static byte[]` | `deriveIpek(byte[] bdk, byte[] ksn)`
    `static byte[]` | `deriveKey(byte[] ksn, byte[] ipek)`
    `static byte[]` | `deriveKey(byte[] derivationKey, DUKPT.KeyType keyType, byte[] derivationData)`
    `static byte[]` | `deriveMacKey(byte[] ksn, byte[] ipek)`
    `static byte[]` | `derivePinKey(byte[] ksn, byte[] ipek)`
    `static byte[]` | `deriveWorkingKey(byte[] BDK, DUKPT.KeyType deriveKeyType, DUKPT.KeyUsage workingKeyUsage, DUKPT.KeyType workingKeyType, byte[] ksn)`
    `static byte[]` | `deriveWorkingKey(byte[] BDK, DUKPT.KeyType deriveKeyType, DUKPT.KeyUsage workingKeyUsage, DUKPT.KeyType workingKeyType, byte[] initialKeyID, int transactionCounter)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DUKPT

          public DUKPT()

  - ### Method Detail

    - #### deriveKey

          public static byte[] deriveKey(byte[] ksn,
                                         byte[] ipek)

    - #### deriveDataKey

          public static byte[] deriveDataKey(byte[] ksn,
                                             byte[] ipek)

    - #### derivePinKey

          public static byte[] derivePinKey(byte[] ksn,
                                            byte[] ipek)

    - #### deriveMacKey

          public static byte[] deriveMacKey(byte[] ksn,
                                            byte[] ipek)

    - #### deriveIpek

          public static byte[] deriveIpek(byte[] bdk,
                                          byte[] ksn)

    - #### deriveKey

          public static byte[] deriveKey(byte[] derivationKey,
                                         DUKPT.KeyType keyType,
                                         byte[] derivationData)

    - #### createDerivationData

          public static byte[] createDerivationData(DUKPT.DerivationPurpose derivationPurpose,
                                                    DUKPT.KeyUsage keyUsage,
                                                    DUKPT.KeyType derivedKeyType,
                                                    byte[] initialKeyID,
                                                    int counter)

    - #### deriveInitialKey

          public static byte[] deriveInitialKey(byte[] BDK,
                                                DUKPT.KeyType keyType,
                                                byte[] initialKeyID)

    - #### deriveWorkingKey

          public static byte[] deriveWorkingKey(byte[] BDK,
                                                DUKPT.KeyType deriveKeyType,
                                                DUKPT.KeyUsage workingKeyUsage,
                                                DUKPT.KeyType workingKeyType,
                                                byte[] initialKeyID,
                                                int transactionCounter)

    - #### deriveWorkingKey

          public static byte[] deriveWorkingKey(byte[] BDK,
                                                DUKPT.KeyType deriveKeyType,
                                                DUKPT.KeyUsage workingKeyUsage,
                                                DUKPT.KeyType workingKeyType,
                                                byte[] ksn)