Package com.orientechnologies.orient.core.exception

Examples of com.orientechnologies.orient.core.exception.OSecurityException


    try {
      kg = KeyGenerator.getInstance(iAlgorithm);
      kg.init(iKeySize);
      return kg.generateKey();
    } catch (Exception e) {
      throw new OSecurityException("Error on generating key for algorithm: " + iAlgorithm, e);
    }
  }
View Full Code Here


    try {
      c = Cipher.getInstance(iAlgorithm);
      c.init(Cipher.ENCRYPT_MODE, iKey);
      return c.doFinal(iData);
    } catch (Exception e) {
      throw new OSecurityException("Error on encrypting data", e);
    }
  }
View Full Code Here

    try {
      c = Cipher.getInstance(iAlgorithm);
      c.init(Cipher.DECRYPT_MODE, iKey);
      return c.doFinal(iData);
    } catch (Exception e) {
      throw new OSecurityException("Error on decrypting data", e);
    }
  }
View Full Code Here

  public OUser create() {
    acquireExclusiveLock();
    try {

      if (getDatabase().getMetadata().getSchema().getClasses().size() > 0)
        throw new OSecurityException("Default users and roles already installed");

      // CREATE ROLE AND USER SCHEMA CLASSES
      final OClass roleClass = getDatabase().getMetadata().getSchema().createClass("ORole");
      roleClass.createProperty("mode", OType.BYTE);
      roleClass.createProperty("rules", OType.EMBEDDEDMAP, OType.BYTE);
View Full Code Here

    try {
      kg = KeyGenerator.getInstance(iAlgorithm);
      kg.init(iKeySize);
      return kg.generateKey();
    } catch (Exception e) {
      throw new OSecurityException("Error on generating key for algorithm: " + iAlgorithm, e);
    }
  }
View Full Code Here

    try {
      c = Cipher.getInstance(iAlgorithm);
      c.init(Cipher.ENCRYPT_MODE, iKey);
      return c.doFinal(iData);
    } catch (Exception e) {
      throw new OSecurityException("Error on encrypting data", e);
    }
  }
View Full Code Here

    try {
      c = Cipher.getInstance(iAlgorithm);
      c.init(Cipher.DECRYPT_MODE, iKey);
      return c.doFinal(iData);
    } catch (Exception e) {
      throw new OSecurityException("Error on decrypting data", e);
    }
  }
View Full Code Here

      final String clusterName = channel.readString();
      final byte[] encodedSecurityKey = channel.readBytes();
      final long runningSince = channel.readLong();

      if (!clusterName.equals(manager.getName()) || !Arrays.equals(encodedSecurityKey, manager.getSecurityKey()))
        throw new OSecurityException("Invalid combination of cluster name and key received");

      channel.acquireExclusiveLock();
      try {
        sendOk(lastClientTxId);
View Full Code Here

  public void onMessage(String iText) {
  }

  protected void checkConnected() {
    if (!manager.isLeaderConnected())
      throw new OSecurityException("Invalid request from a non-connected node");
  }
View Full Code Here

      data.commandInfo = "Cluster connection";
      final String clusterName = channel.readString();
      final byte[] encodedSecurityKey = channel.readBytes();

      if (!clusterName.equals(manager.getName()) || !Arrays.equals(encodedSecurityKey, manager.getSecurityKey()))
        throw new OSecurityException("Invalid combination of cluster name and key received");

      manager.receivedLeaderConnection(this);
      sendOk(lastClientTxId);
      break;
    }
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.exception.OSecurityException

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.