Package ch.ethz.inf.vs.scandium.dtls.CertificateTypeExtension

Examples of ch.ethz.inf.vs.scandium.dtls.CertificateTypeExtension.CertificateType


     
      HelloExtensions extensions = null;
      ClientCertificateTypeExtension clientCertificateTypeExtension = clientHello.getClientCertificateTypeExtension();
      if (clientCertificateTypeExtension != null) {
        // choose certificate type from client's list
        CertificateType certType = negotiateCertificateType(clientCertificateTypeExtension);
        extensions = new HelloExtensions();
        // the certificate type requested from the client
        CertificateTypeExtension ext1 = new ClientCertificateTypeExtension(false);
        ext1.addCertificateType(certType);
       
        extensions.addExtension(ext1);
       
        if (certType == CertificateType.RAW_PUBLIC_KEY) {
          session.setReceiveRawPublicKey(true);
        }
      }
     
      CertificateTypeExtension serverCertificateTypeExtension = clientHello.getServerCertificateTypeExtension();
      if (serverCertificateTypeExtension != null) {
        // choose certificate type from client's list
        CertificateType certType = negotiateCertificateType(serverCertificateTypeExtension);
        if (extensions == null) {
          extensions = new HelloExtensions();
        }
        // the certificate type found in the attached certificate payload
        CertificateTypeExtension ext2 = new ServerCertificateTypeExtension(false);
View Full Code Here


   *            the certificate type extension.
   * @return the certificate type in which the client will send its
   *         certificate.
   */
  private CertificateType negotiateCertificateType(CertificateTypeExtension extension) {
    CertificateType certType = CertificateType.X_509;
    for (CertificateType type : extension.getCertificateTypes()) {
      return type;
    }
    return certType;
  }
View Full Code Here

TOP

Related Classes of ch.ethz.inf.vs.scandium.dtls.CertificateTypeExtension.CertificateType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.