Package org.platformlayer.auth.crypto

Examples of org.platformlayer.auth.crypto.SecretStore$Reader


    ProjectEntity project = userRepository.findProjectByKey(projectKey.getKey());
    if (project == null) {
      throw new CliException("Project not found: " + projectKey.getKey());
    }

    SecretStore secretStore = new SecretStore(project.secretData);
    CryptoKey projectSecret = secretStore.getSecretFromUser(me);
    if (projectSecret == null) {
      String msg = "Cannot retrieve project secret.";
      msg += " Is " + me.key + " a member of " + project.getName() + "?";
      throw new CliException(msg);
    }
View Full Code Here


    }
    return userSecret;
  }

  public CryptoKey unlockWithPassword(String password) {
    SecretStore secretStore = new SecretStore(secret);
    this.userSecret = secretStore.getSecretFromPassword(id, password);
    if (this.userSecret == null) {
      throw new SecurityException();
    }
    return this.userSecret;
  }
View Full Code Here

  public int getId() {
    return id;
  }

  public byte[] findChallenge(X509Certificate[] certificateChain) {
    SecretStore secretStore = new SecretStore(secret);
    return secretStore.findChallengeForCertificate(certificateChain);
  }
View Full Code Here

    }
    return projectSecret;
  }

  public void unlockWithUser(UserEntity user) {
    SecretStore secretStore = new SecretStore(this.secretData);
    this.projectSecret = secretStore.getSecretFromUser(user);
    if (this.projectSecret == null) {
      throw new SecurityException();
    }
  }
View Full Code Here

      throw new SecurityException();
    }
  }

  public void unlockWithProject(ProjectEntity project) {
    SecretStore secretStore = new SecretStore(this.secretData);
    this.projectSecret = secretStore.getSecretFromProject(project);
    if (this.projectSecret == null) {
      throw new SecurityException();
    }
  }
View Full Code Here

      PublicKey userPublicKey = user.getPublicKey();

      byte[] newSecretData;
      try {
        SecretStore store = new SecretStore(project.secretData);
        Writer writer = store.buildWriter();
        writer.writeAsymetricUserKey(projectSecretData, user.id, userPublicKey);
        writer.close();
        store.appendContents(writer);

        newSecretData = store.getEncoded();
      } catch (IOException e) {
        throw new RepositoryException("Error writing secrets", e);
      }

      db.updateProjectSecret(project.id, newSecretData);
View Full Code Here

      PublicKey grantToProjectPublicKey = grantToProject.getPublicKey();

      byte[] newSecretData;
      try {
        SecretStore store = new SecretStore(onProject.secretData);
        Writer writer = store.buildWriter();
        writer.writeAsymetricProjectKey(projectSecretData, grantToProject.id, grantToProjectPublicKey);
        writer.close();
        store.appendContents(writer);

        newSecretData = store.getEncoded();
      } catch (IOException e) {
        throw new RepositoryException("Error writing secrets", e);
      }

      db.updateProjectSecret(onProject.id, newSecretData);
View Full Code Here

  //
  // return FathomdbCrypto.decrypt(secretKey, data);
  // }

  public CryptoKey getSecret(byte[] secret) {
    SecretStore secretStore = new SecretStore(secret);

    CryptoKey secretKey = null;

    for (ProjectAuthorization project : OpsContext.get().getEncryptingProjects()) {
      secretKey = secretStore.getSecretFromProject(project);
      if (secretKey != null) {
        break;
      }
    }
View Full Code Here

  public static void main(String[] args) {

    // Creates an object to store the prices
    PricesInfo pricesInfo=new PricesInfo();
   
    Reader readers[]=new Reader[5];
    Thread threadsReader[]=new Thread[5];
   
    // Creates five readers and threads to run them
    for (int i=0; i<5; i++){
      readers[i]=new Reader(pricesInfo);
      threadsReader[i]=new Thread(readers[i]);
    }
   
    // Creates a writer and a thread to run it
    Writer writer=new Writer(pricesInfo);
View Full Code Here

TOP

Related Classes of org.platformlayer.auth.crypto.SecretStore$Reader

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.