Class K


  • public class K
    extends java.lang.Object
    Key generation functions for the Simple Payload.
    • Constructor Detail

      • K

        public K()
    • Method Detail

      • date

        @Nullable
        protected static java.util.Date date​(@NonNull
                                             java.lang.String fromString)
        Date from string date "yyyy-MM-dd'T'HH:mm:ssXXXX" in UTC
        Parameters:
        fromString - Time string in UTC timezone
        Returns:
        Herald Date instance
      • getEpoch

        @NonNull
        protected static TimeInterval getEpoch()
      • day

        protected static int day​(@NonNull
                                 java.util.Date onDate)
      • period

        protected static int period​(@NonNull
                                    java.util.Date atTime)
      • secretKey

        @NonNull
        protected static SecretKey secretKey()
      • getSecureRandom

        @NonNull
        public static java.security.SecureRandom getSecureRandom()
      • matchingKeys

        @NonNull
        protected static MatchingKey[] matchingKeys​(@NonNull
                                                    SecretKey secretKey)
        Generate matching keys K_{m}^{0...days}
        Parameters:
        secretKey - The SecretKey to use to generate the sequence of daily MatchingKeys
        Returns:
      • contactKeys

        @NonNull
        protected static ContactKey[] contactKeys​(@NonNull
                                                  MatchingKey matchingKey)
        Generate contact keys K_{c}^{0...periods}
        Parameters:
        matchingKey - The daily MatchingKey to use to generate a set of period ContactKeys
        Returns:
        The ContactKey set generated from the MatchingKey
      • contactIdentifier

        @NonNull
        protected static ContactIdentifier contactIdentifier​(@NonNull
                                                             ContactKey contactKey)
        Generate contact identifer I_{c}
        Parameters:
        contactKey - The ContactKey used to generate this period's ContactIdentifier