Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSForwardException


            out.writeObject(_secretDESKey);
            out.close();
            is = new FileInputStream(new File(_secretKeyPath));
          }
          catch (java.security.NoSuchAlgorithmException ex) {
            throw new NSForwardException(ex, "Couldn't find the DES algorithm; perhaps you do not have the SunJCE security provider installed properly?");
          }
          catch (Exception ex) {
            throw NSForwardException._runtimeExceptionForThrowable(ex);
          }
        }
View Full Code Here


      stringBytes = ERXCompressionUtilities.inflateByteArray(stringBytes);
      String decString = new String(stringBytes, "UTF8");
      return decString;
    }
    catch (java.security.NoSuchAlgorithmException ex) {
      throw new NSForwardException(ex, "Couldn't find the DES algorithm; perhaps you do not have the SunJCE security provider installed properly?");
    }
    catch (Exception ex) {
      throw new NSForwardException(ex);
    }
  }
View Full Code Here

      byte[] raw = cipher.doFinal(stringBytes);
      String encBase64String = ERXCrypto.base64Encode(raw);
      return encBase64String;
    }
    catch (java.security.NoSuchAlgorithmException ex) {
      throw new NSForwardException(ex, "Couldn't find the DES algorithm; perhaps you do not have the SunJCE security provider installed properly?");
    }
    catch (Exception ex) {
      throw new NSForwardException(ex);
    }
  }
View Full Code Here

          try {
            ERXCrypterInterface crypter = Class.forName(crypterClassName).asSubclass(ERXCrypterInterface.class).newInstance();
            _crypters.setObjectForKey(crypter, crypterAlgorithm);
          }
          catch (Exception e) {
            throw new NSForwardException(e, "Failed to create " + crypterAlgorithm + " crypter '" + crypterClassName + "'.");
          }
        }
      }
    }
    return _crypters;
View Full Code Here

      MessageDigest md = MessageDigest.getInstance("SHA");
      md.update(v.getBytes());
      base64HashedPassword = Base64.encodeBase64String(md.digest());
    }
    catch (NoSuchAlgorithmException e) {
      throw new NSForwardException(e, "Couldn't find the SHA hash algorithm; perhaps you do not have the SunJCE security provider installed properly?");
    }
    return base64HashedPassword;
  }
View Full Code Here

      MessageDigest md = MessageDigest.getInstance(algorithmName);
      md.update(buf);
      return ERXStringUtilities.byteArrayToHexString(md.digest());
    }
    catch (NoSuchAlgorithmException ex) {
      throw new NSForwardException(ex, "Couldn't find the algorithm '" + algorithmName
          + "'; perhaps you do not have the SunJCE security provider installed properly?");
    }
  }
View Full Code Here

    if (_secretKey == null) {
      try {
        _secretKey = secretKey();
      }
      catch (Exception e) {
        throw new NSForwardException(e);
      }
    }
    return _secretKey;
  }
View Full Code Here

      Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding");
      cipher.init(mode, _secretKey());
      return cipher;
    }
    catch (java.security.NoSuchAlgorithmException ex) {
      throw new NSForwardException(ex, "Couldn't find the AES algorithm; perhaps you do not have the SunJCE security provider installed properly?");
    }
    catch (Exception e) {
      throw new NSForwardException(e);
    }
  }
View Full Code Here

      System.arraycopy(decodedBytes, j, encryptedBytes, 0, Math.min(length - j, _blockSize));
      try {
        clearText = decryptCipher().doFinal(encryptedBytes);
      }
      catch (Exception e) {
        throw new NSForwardException(e);
      }
      for (int k = 0; k < _blockSize; k++) {
        if (clearText[k] != 0) {
          result.write(clearText[k]);
        }
View Full Code Here

      try {
        encryptedBytes = encryptCipher().doFinal(bytesToEncrypt);
        result.write(encryptedBytes);
      }
      catch (Exception e) {
        throw new NSForwardException(e);
      }
      pos += _blockSize;
    }
    return ERXCrypto.base64urlEncode(result.toByteArray());
  }
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSForwardException

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.