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

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

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

origin: oberasoftware/jasdb

@Override
public UserSession startSession(Credentials credentials) throws JasDBStorageException {
  User user = userManager.authenticate(credentials);
  String sessionId = UUID.randomUUID().toString();
  String token = UUID.randomUUID().toString();
  CryptoEngine userEncryptionEngine = CryptoFactory.getEngine(user.getEncryptionEngine());
  String encryptedContentKey = user.getEncryptedContentKey();
  String contentKey = userEncryptionEngine.decrypt(user.getPasswordSalt(), credentials.getPassword(), encryptedContentKey);
  encryptedContentKey = userEncryptionEngine.encrypt(user.getPasswordSalt(), token, contentKey);
  UserSession session = new UserSessionImpl(sessionId, token, encryptedContentKey, user);
  userManager.authorize(session, "/", AccessMode.CONNECT);
  secureUserSessionMap.put(sessionId, new SecureUserSession(session));
  return session;
}
origin: oberasoftware/jasdb

private GrantObject decrypt(UserSession session, EncryptedGrants encryptedGrants) throws JasDBStorageException {
  CryptoEngine contentCryptoEngine = CryptoFactory.getEngine();
  String contentKey = contentCryptoEngine.decrypt(session.getUser().getPasswordSalt(), session.getAccessToken(), session.getEncryptedContentKey());
  CryptoEngine cryptoEngine = CryptoFactory.getEngine(encryptedGrants.getEncryptionEngine());
  String decryptedData = cryptoEngine.decrypt(encryptedGrants.getSalt(), contentKey, encryptedGrants.getEncryptedData());
  return GrantObjectMeta.fromEntity(SimpleEntity.fromJson(decryptedData));
}
origin: oberasoftware/jasdb

@Override
public User addUser(UserSession currentSession, String userName, String allowedHost, String password) throws JasDBStorageException {
  authorize(currentSession, "/Users", AccessMode.WRITE);
  User currentUser = currentSession.getUser();
  CryptoEngine cryptoEngine = CryptoFactory.getEngine();
  String contentKey = cryptoEngine.decrypt(currentUser.getPasswordSalt(), currentSession.getAccessToken(), currentSession.getEncryptedContentKey());
  return credentialsProvider.addUser(userName, allowedHost, contentKey, password);
}
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.securityCryptoEnginedecrypt

Popular methods of CryptoEngine

  • hash
  • encrypt
  • generateSalt
  • getDescriptor

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 Vim 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