Tabnine Logo
RegistrationAssertionHelper.getAssertion
Code IndexAdd Tabnine to your IDE (free)

How to use
getAssertion
method
in
org.eclipse.hono.service.registration.RegistrationAssertionHelper

Best Java code snippets using org.eclipse.hono.service.registration.RegistrationAssertionHelper.getAssertion (Showing top 3 results out of 315)

origin: org.eclipse.hono/hono-service-base

/**
 * Creates a registration assertion token for a device and wraps it in a JSON object.
 * <p>
 * The returned JSON object may also contain <em>default</em> values registered for the
 * device under key {@link RegistrationConstants#FIELD_DEFAULTS}.
 * 
 * @param tenantId The tenant the device belongs to.
 * @param deviceId The device to create the assertion token for.
 * @param registrationInfo The device's registration information.
 * @return The payload.
 */
protected final JsonObject getAssertionPayload(final String tenantId, final String deviceId, final JsonObject registrationInfo) {
  final JsonObject result = new JsonObject()
      .put(RegistrationConstants.FIELD_PAYLOAD_DEVICE_ID, deviceId)
      .put(RegistrationConstants.FIELD_ASSERTION, assertionFactory.getAssertion(tenantId, deviceId));
  final JsonObject defaults = registrationInfo.getJsonObject(RegistrationConstants.FIELD_DEFAULTS);
  if (defaults != null) {
    result.put(RegistrationConstants.FIELD_DEFAULTS, defaults);
  }
  return result;
}
origin: eclipse/hono

/**
 * Creates a registration assertion token for a device and wraps it in a JSON object.
 * <p>
 * The returned JSON object may also contain <em>default</em> values registered for the
 * device under key {@link RegistrationConstants#FIELD_DEFAULTS}.
 * 
 * @param tenantId The tenant the device belongs to.
 * @param deviceId The device to create the assertion token for.
 * @param registrationInfo The device's registration information.
 * @return The payload.
 */
protected final JsonObject getAssertionPayload(final String tenantId, final String deviceId, final JsonObject registrationInfo) {
  final JsonObject result = new JsonObject()
      .put(RegistrationConstants.FIELD_PAYLOAD_DEVICE_ID, deviceId)
      .put(RegistrationConstants.FIELD_ASSERTION, assertionFactory.getAssertion(tenantId, deviceId));
  final JsonObject defaults = registrationInfo.getJsonObject(RegistrationConstants.FIELD_DEFAULTS);
  if (defaults != null) {
    result.put(RegistrationConstants.FIELD_DEFAULTS, defaults);
  }
  return result;
}
origin: eclipse/hono

/**
 * Verifies that signatures created using an RSA private key can be validated using the corresponding public key.
 */
@Test
public void testForSigningWorksWithRsaSignatures() {
  final SignatureSupportingConfigProperties props = new SignatureSupportingConfigProperties();
  props.setKeyPath("target/certs/hono-messaging-key.pem");
  props.setCertPath("target/certs/hono-messaging-cert.pem");
  final RegistrationAssertionHelper factory = RegistrationAssertionHelperImpl.forSigning(vertx, props);
  final String assertion = factory.getAssertion("tenant", "device");
  assertNotNull(assertion);
  final RegistrationAssertionHelper validator = RegistrationAssertionHelperImpl.forValidating(vertx, props);
  assertTrue(validator.isValid(assertion, "tenant", "device"));
}
org.eclipse.hono.service.registrationRegistrationAssertionHelpergetAssertion

Javadoc

Creates a signed assertion.

Popular methods of RegistrationAssertionHelper

  • getAssertionLifetime
    Gets the lifetime of the assertions created by the getAssertion method.
  • isValid
    Checks if a given token asserts a particular device's registration status.

Popular in Java

  • Finding current android device location
  • requestLocationUpdates (LocationManager)
  • getSupportFragmentManager (FragmentActivity)
  • onRequestPermissionsResult (Fragment)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Path (java.nio.file)
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • BoxLayout (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now