Tabnine Logo
CryptoEngine.getDescriptor
Code IndexAdd Tabnine to your IDE (free)

How to use
getDescriptor
method
in
com.oberasoftware.jasdb.api.security.CryptoEngine

Best Java code snippets using com.oberasoftware.jasdb.api.security.CryptoEngine.getDescriptor (Showing top 3 results out of 315)

origin: oberasoftware/jasdb

private void createMandatoryAdminUser() throws JasDBStorageException {
  CryptoEngine cryptoEngine = CryptoFactory.getEngine();
  String salt = cryptoEngine.generateSalt();
  String contentKey = cryptoEngine.generateSalt();
  String encryptedContentKey = cryptoEngine.encrypt(salt, "", contentKey);
  User user = new UserMeta("admin", "localhost", encryptedContentKey, salt, cryptoEngine.hash(salt, ""), cryptoEngine.getDescriptor());
  userMetadataProvider.addUser(user);
  Grant grant = new GrantMeta("admin", AccessMode.ADMIN);
  GrantObjectMeta grantsMeta = new GrantObjectMeta(Constants.OBJECT_SEPARATOR, grant);
  String unencryptedGrants = SimpleEntity.toJson(GrantObjectMeta.toEntity(grantsMeta));
  String encryptedGrants = cryptoEngine.encrypt(salt, contentKey, unencryptedGrants);
  EncryptedGrants grants = new EncryptedGrants(grantsMeta.getObjectName(), encryptedGrants, salt, cryptoEngine.getDescriptor());
  grantMetadataProvider.persistGrant(grants);
}
origin: oberasoftware/jasdb

  @Override
  public User addUser(String userName, String allowedHost, String contentKey, String password) throws JasDBStorageException {
    if(!userMetadataProvider.hasUser(userName)) {
      CryptoEngine cryptoEngine = CryptoFactory.getEngine();
      String salt = cryptoEngine.generateSalt();
      String encryptedContentKey = cryptoEngine.encrypt(salt, password, contentKey);
      String passwordHash = cryptoEngine.hash(salt, password);

      User user = new UserMeta(userName, allowedHost, encryptedContentKey, salt, passwordHash, cryptoEngine.getDescriptor());
      userMetadataProvider.addUser(user);
      return user;
    } else {
      return userMetadataProvider.getUser(userName);
    }
  }
}
origin: oberasoftware/jasdb

private EncryptedGrants encryptGrants(GrantObject grantObject, UserSession userSession) throws JasDBStorageException {
  CryptoEngine cryptoEngine = CryptoFactory.getEngine();
  String contentKey = CryptoFactory.getEngine().decrypt(userSession.getUser().getPasswordSalt(), userSession.getAccessToken(), userSession.getEncryptedContentKey());
  String salt = cryptoEngine.generateSalt();
  String unencryptedData = SimpleEntity.toJson(GrantObjectMeta.toEntity(grantObject));
  String encryptedData = cryptoEngine.encrypt(salt, contentKey, unencryptedData);
  return new EncryptedGrants(grantObject.getObjectName(), encryptedData, salt, cryptoEngine.getDescriptor());
}
com.oberasoftware.jasdb.api.securityCryptoEnginegetDescriptor

Popular methods of CryptoEngine

  • hash
  • decrypt
  • encrypt
  • generateSalt

Popular in Java

  • Reading from database using SQL prepared statement
  • getExternalFilesDir (Context)
  • findViewById (Activity)
  • putExtra (Intent)
  • Menu (java.awt)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • JButton (javax.swing)
  • Top Sublime Text plugins
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