congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
X509Authentication
Code IndexAdd Tabnine to your IDE (free)

How to use
X509Authentication
in
org.eclipse.hono.service.auth.device

Best Java code snippets using org.eclipse.hono.service.auth.device.X509Authentication (Showing top 2 results out of 315)

origin: eclipse/hono

@Override
public final void parseCredentials(final RoutingContext context, final Handler<AsyncResult<JsonObject>> handler) {
  Objects.requireNonNull(context);
  Objects.requireNonNull(handler);
  if (context.request().isSSL()) {
    try {
      final Certificate[] path = context.request().sslSession().getPeerCertificates();
      final SpanContext currentSpan = TracingHandler.serverSpanContext(context);
      auth.validateClientCertificate(path, currentSpan).setHandler(handler);
    } catch (SSLPeerUnverifiedException e) {
      // client certificate has not been validated
      LOG.debug("could not retrieve client certificate from request: {}", e.getMessage());
      handler.handle(Future.failedFuture(UNAUTHORIZED));
    }
  } else {
    handler.handle(Future.failedFuture(UNAUTHORIZED));
  }
}
origin: eclipse/hono

  @Override
  public Future<JsonObject> parseCredentials(final MqttContext context) {

    Objects.requireNonNull(context);

    if (context.deviceEndpoint().isSsl()) {
      try {
        final Certificate[] path = context.deviceEndpoint().sslSession().getPeerCertificates();
        final SpanContext currentSpan = context.getTracingContext();
        return auth.validateClientCertificate(path, currentSpan);
      } catch (SSLPeerUnverifiedException e) {
        // client certificate has not been validated
        log.debug("could not retrieve client certificate from device endpoint: {}", e.getMessage());
        return Future.failedFuture(UNAUTHORIZED);
      }
    } else {
      return Future.failedFuture(UNAUTHORIZED);
    }
  }
}
org.eclipse.hono.service.auth.deviceX509Authentication

Javadoc

A strategy for authenticating clients based on X.509 client certificates.

Most used methods

  • validateClientCertificate
    Validates a certificate path.

Popular in Java

  • Making http post requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • getExternalFilesDir (Context)
  • runOnUiThread (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • JTextField (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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