Package com.gitblit.utils.X509Utils

Examples of com.gitblit.utils.X509Utils.X509Metadata


  public void testCertificateRevocation() throws Exception {
    File storeFile = new File(folder, X509Utils.CA_KEY_STORE);
    PrivateKey caPrivateKey = X509Utils.getPrivateKey(X509Utils.CA_ALIAS, storeFile, caPassword);
    X509Certificate caCert = X509Utils.getCertificate(X509Utils.CA_ALIAS, storeFile, caPassword);

    X509Metadata userMetadata = new X509Metadata("james", "james");
    userMetadata.serverHostname = "www.myserver.com";
    userMetadata.userDisplayname = "James Moger";
    userMetadata.passwordHint = "your name";

    // generate a new client certificate
View Full Code Here


    String [] oids = settings.getStrings(Keys.git.certificateUsernameOIDs).toArray(new String[0]);
    UserModel model = HttpUtils.getUserModelFromCertificate(httpRequest, checkValidity, oids);
    if (model != null) {
      // grab real user model and preserve certificate serial number
      UserModel user = userManager.getUserModel(model.username);
      X509Metadata metadata = HttpUtils.getCertificateMetadata(httpRequest);
      if (user != null) {
        flagSession(httpRequest, AuthenticationType.CERTIFICATE);
        logger.debug(MessageFormat.format("{0} authenticated by client certificate {1} from {2}",
            user.username, metadata.serialNumber, httpRequest.getRemoteAddr()));
        return validateAuthentication(user, AuthenticationType.CERTIFICATE);
View Full Code Here

TOP

Related Classes of com.gitblit.utils.X509Utils.X509Metadata

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.