Package org.apache.xml.security.exceptions

Examples of org.apache.xml.security.exceptions.XMLSecurityException


    *
    * @throws XMLSecurityException
    */
   public byte[] engineEncrypt(byte[] plaintextBytes, Key contentKey, byte[] IV)
           throws XMLSecurityException {
      throw new XMLSecurityException(
         "encryption.algorithmCannotEncryptDecrypt");
   }
View Full Code Here


    *
    * @throws XMLSecurityException
    */
   public byte[] engineDecrypt(byte[] ciphertextBytes, Key contentKey)
           throws XMLSecurityException {
      throw new XMLSecurityException(
         "encryption.algorithmCannotEncryptDecrypt");
   }
View Full Code Here

   public EncryptionMethodParams engineInit(
           Document doc, EncryptionMethodParams params)
              throws org.apache.xml.security.exceptions.XMLSecurityException {

      if (params != null) {
         throw new XMLSecurityException(
            "encryption.algorithmCannotEatInitParams");
      }

      try {
         this._cipher = Cipher.getInstance(this.getImplementedAlgorithmJCE(),
                                           this.getRequiredProviderName());

         MessageDigestAlgorithm mda = MessageDigestAlgorithm.getInstance(doc,
                                         Constants.ALGO_ID_DIGEST_SHA1);

         this._sha1digest = mda.getAlgorithm();
      } catch (NoSuchAlgorithmException ex) {
         throw new XMLSecurityException("empty", ex);
      } catch (NoSuchProviderException ex) {
         throw new XMLSecurityException("empty", ex);
      } catch (NoSuchPaddingException ex) {
         throw new XMLSecurityException("empty", ex);
      }

      return params;
   }
View Full Code Here

    */
   public EncryptionMethodParams engineInit(Element encryptionMethodElem)
           throws org.apache.xml.security.exceptions.XMLSecurityException {

      if (encryptionMethodElem.getChildNodes().getLength() != 0) {
         throw new XMLSecurityException(
            "encryption.algorithmCannotEatInitParams");
      }

      try {
         this._cipher = Cipher.getInstance(this.getImplementedAlgorithmJCE(),
                                           this.getRequiredProviderName());

         MessageDigestAlgorithm mda =
            MessageDigestAlgorithm
               .getInstance(encryptionMethodElem.getOwnerDocument(), Constants
                  .ALGO_ID_DIGEST_SHA1);

         this._sha1digest = mda.getAlgorithm();
      } catch (NoSuchAlgorithmException ex) {
         throw new XMLSecurityException("empty", ex);
      } catch (NoSuchProviderException ex) {
         throw new XMLSecurityException("empty", ex);
      } catch (NoSuchPaddingException ex) {
         throw new XMLSecurityException("empty", ex);
      }

      return null;
   }
View Full Code Here

         TripleDESWrapper wrapper = new TripleDESWrapper(this._cipher,
                                       this._sha1digest);

         return wrapper.wrap(contentKey.getEncoded(), wrapKey, IV);
      } catch (InvalidKeyException ex) {
         throw new XMLSecurityException("empty", ex);
      } catch (InvalidAlgorithmParameterException ex) {
         throw new XMLSecurityException("empty", ex);
      } catch (IllegalBlockSizeException ex) {
         throw new XMLSecurityException("empty", ex);
      }
   }
View Full Code Here

            }

            throw new InvalidKeyException("Unknown key type " + wrappedKeyType);
         }
      } catch (InvalidKeyException ex) {
         throw new XMLSecurityException("empty", ex);
      }
   }
View Full Code Here

    *
    * @throws org.apache.xml.security.exceptions.XMLSecurityException
    */
   public byte[] engineEncrypt(byte[] plaintextBytes, Key contentKey)
           throws org.apache.xml.security.exceptions.XMLSecurityException {
      throw new XMLSecurityException(
         "encryption.algorithmCannotEncryptDecrypt");
   }
View Full Code Here

    *
    * @throws org.apache.xml.security.exceptions.XMLSecurityException
    */
   public byte[] engineEncrypt(byte[] plaintextBytes, Key contentKey, byte[] IV)
           throws org.apache.xml.security.exceptions.XMLSecurityException {
      throw new XMLSecurityException(
         "encryption.algorithmCannotEncryptDecrypt");
   }
View Full Code Here

    *
    * @throws org.apache.xml.security.exceptions.XMLSecurityException
    */
   public byte[] engineDecrypt(byte[] ciphertextBytes, Key contentKey)
           throws org.apache.xml.security.exceptions.XMLSecurityException {
      throw new XMLSecurityException(
         "encryption.algorithmCannotEncryptDecrypt");
   }
View Full Code Here

           throws XMLSecurityException {

      this._doc = doc;

      if (params != null) {
         throw new XMLSecurityException("empty");
      }

      try {
         Cipher rsaCipher =
            Cipher.getInstance(this.getImplementedAlgorithmJCE(),
                               this.getRequiredProviderName());

         this._cipher = new PKCS15Cipher(rsaCipher);
      } catch (NoSuchAlgorithmException ex) {
         throw new XMLSecurityException("empty", ex);
      } catch (NoSuchProviderException ex) {
         throw new XMLSecurityException("empty", ex);
      } catch (NoSuchPaddingException ex) {
         throw new XMLSecurityException("empty", ex);
      }

      return params;
   }
View Full Code Here

TOP

Related Classes of org.apache.xml.security.exceptions.XMLSecurityException

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.