Class EngagementGenerator


  • public final class EngagementGenerator
    extends java.lang.Object
    Helper to generate DeviceEngagement or ReaderEngagement CBOR.
    • Field Detail

      • ENGAGEMENT_VERSION_1_0

        public static final java.lang.String ENGAGEMENT_VERSION_1_0
        See Also:
        Constant Field Values
      • ENGAGEMENT_VERSION_1_1

        public static final java.lang.String ENGAGEMENT_VERSION_1_1
        See Also:
        Constant Field Values
    • Constructor Detail

      • EngagementGenerator

        public EngagementGenerator​(@NonNull
                                   java.security.PublicKey ESenderKey,
                                   @NonNull
                                   java.lang.String version)
        Helper class for building Engagement structures.
        Parameters:
        ESenderKey - The ephemeral key used by the device (when generating DeviceEngagement) or the reader (when generating ReaderEngagement).
        version - the version to use.
    • Method Detail

      • setConnectionMethods

        @NonNull
        public EngagementGenerator setConnectionMethods​(@NonNull
                                                        java.util.List<ConnectionMethod> connectionMethods)
        Adds a connection method to the engagement.
        Parameters:
        connectionMethods - A list with instances derived from ConnectionMethod.
        Returns:
        the generator.
      • setOriginInfos

        @NonNull
        public EngagementGenerator setOriginInfos​(@NonNull
                                                  java.util.List<OriginInfo> originInfos)
        Adds origin infos to the engagement.
        Parameters:
        originInfos - A list with instances derived from OriginInfo.
        Returns:
        the generator.
      • generate

        @NonNull
        public byte[] generate()
        Generates the binary Engagement structure.
        Returns:
        the bytes of the Engagement structure.