Package org.apache.xml.security.exceptions

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


               // org.apache.xml.security.keys.keyStorage.KeyStorage.registerStore(URI, JAVACLASS, LOCATION, DEFAULTKEYOBJECT, CONTEXT);
            }
         }
      } catch (Exception ex) {
         throw new XMLSecurityException("generic.EmptyMessage", ex);
      }
   }
View Full Code Here


      NodeList nl = this._constructionElement.getChildNodes();

      if ((nl.getLength() != 1)
              || (nl.item(0).getNodeType() != Node.TEXT_NODE)) {
         throw new XMLSecurityException(
            "encryption.structure.CipherTextMustContainText");
      }

      Text t = (Text) nl.item(0);
View Full Code Here

         XMLUtils.getDirectChild(encryptionMethodElem,
                                 EncryptionConstants._TAG_OAEPPARAMS,
                                 EncryptionConstants.EncryptionSpecNS);

      if (digestElem == null) {
         throw new XMLSecurityException("encryption.MissingDigestMethod");
      }

      if (paramElem == null) {
         throw new XMLSecurityException("encryption.MissingOAEPParams");
      }

      this._digestMethodURI = digestElem.getAttributeNS(null, Constants._ATT_ALGORITHM);
      this._OAEPParamBytes = Base64.decode(paramElem);
   }
View Full Code Here

            System.arraycopy(AESWrapper.DEFAULT_IV, 0, IV, 0,
                             AESWrapper.DEFAULT_IV.length);
         }

         if (IV.length != 8) {
            throw new XMLSecurityException("empty");
         }

         int inLen = keyToBeWrapped.length;
         int n = inLen / 8;

         if ((keyToBeWrapped.length % 8) != 0) {
            throw new XMLSecurityException(
               "wrap data must be a multiple of 8 bytes");
         }

         byte[] block = new byte[keyToBeWrapped.length + IV.length];
         byte[] buf = new byte[8 + IV.length];

         System.arraycopy(IV, 0, block, 0, IV.length);
         System.arraycopy(keyToBeWrapped, 0, block, IV.length,
                          keyToBeWrapped.length);
         this._cipher.init(Cipher.ENCRYPT_MODE, wrapKey);

         for (int j = 0; j != 6; j++) {
            for (int i = 1; i <= n; i++) {
               System.arraycopy(block, 0, buf, 0, IV.length);
               System.arraycopy(block, 8 * i, buf, IV.length, 8);
               this._cipher.update(buf, 0, buf.length, buf, 0);

               int t = n * j + i;

               for (int k = 1; t != 0; k++) {
                  byte v = (byte) t;

                  buf[IV.length - k] ^= v;
                  t >>>= 8;
               }

               System.arraycopy(buf, 0, block, 0, 8);
               System.arraycopy(buf, 8, block, 8 * i, 8);
            }
         }

         return block;
      } catch (InvalidKeyException ex) {
         throw new XMLSecurityException("empty", ex);
      } catch (ShortBufferException ex) {
         throw new XMLSecurityException("empty", ex);
      }
   }
View Full Code Here

         }

         return block;

      } catch (InvalidKeyException ex) {
         throw new XMLSecurityException("empty", ex);
      } catch (ShortBufferException ex) {
         throw new XMLSecurityException("empty", ex);
      }
   }
View Full Code Here

      super(doc);

      try {
         this.addBase64Text(x509certificate.getEncoded());
      } catch (java.security.cert.CertificateEncodingException ex) {
         throw new XMLSecurityException("empty", ex);
      }
   }
View Full Code Here

            return cert;
         }

         return null;
      } catch (CertificateException ex) {
         throw new XMLSecurityException("empty", ex);
      }
   }
View Full Code Here

            System.arraycopy(baos.toByteArray(), 0, TEMP3, 0, TEMP3.length);
         }

         return TEMP3;
      } catch (IOException ex) {
         throw new XMLSecurityException("empty", ex);
      } catch (BadPaddingException ex) {
         throw new XMLSecurityException("empty", ex);
      }
   }
View Full Code Here

      } catch (InvalidCipherTextException ex) {
         throw ex;
      } catch (XMLSecurityException ex) {
         throw ex;
      } catch (Exception ex) {
         throw new XMLSecurityException("empty", ex);
      }
   }
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());
      } 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.