Fix/update javadoc for fulcrum-yaafi-crypto
git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/yaafi-crypto@1845821 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/java/org/apache/fulcrum/jce/crypto/PasswordFactory.java b/src/java/org/apache/fulcrum/jce/crypto/PasswordFactory.java
index 20ba498..c96713a 100644
--- a/src/java/org/apache/fulcrum/jce/crypto/PasswordFactory.java
+++ b/src/java/org/apache/fulcrum/jce/crypto/PasswordFactory.java
@@ -40,7 +40,12 @@
{
/**
+ * Create a new password
+ *
* @return a default password using "xxxx-xxxx-xxxx-xxxxx"
+ *
+ * @throws NoSuchAlgorithmException the encryption algorithm is not supported
+ * @throws UnsupportedEncodingException the requested encoding is not supported
*/
public static char[] create()
throws NoSuchAlgorithmException, UnsupportedEncodingException
@@ -53,8 +58,13 @@
}
/**
+ * Create a new password using a seed
+ *
* @param seed the default password supplied by the caller
* @return a password using "xxxx-xxxx-xxxx-xxxxx"
+ *
+ * @throws NoSuchAlgorithmException the encryption algorithm is not supported
+ * @throws UnsupportedEncodingException the requested encoding is not supported
*/
public static char[] create( String seed )
throws NoSuchAlgorithmException, UnsupportedEncodingException
@@ -67,6 +77,8 @@
/**
* @param seed the default password supplied by the caller
* @return a password using "xxxx-xxxx-xxxx-xxxxx"
+ * @throws NoSuchAlgorithmException the encryption algorithm is not supported
+ * @throws UnsupportedEncodingException the requested encoding is not supported
*/
public static final char[] create( char[] seed )
throws NoSuchAlgorithmException, UnsupportedEncodingException
@@ -131,7 +143,6 @@
stringBuffer.append( Long.toHexString( long4 ).substring( 0, 5 ) );
// copy the password
-
result = new char[stringBuffer.length()];
for (int i = 0; i < stringBuffer.length(); i++)
@@ -140,7 +151,6 @@
}
// wipe out the StringBuilder
-
for (int i = 0; i < stringBuffer.length(); i++)
{
stringBuffer.setCharAt( i, ' ' );
diff --git a/src/java/org/apache/fulcrum/jce/crypto/SmartDecryptingInputStream.java b/src/java/org/apache/fulcrum/jce/crypto/SmartDecryptingInputStream.java
index 0f47ad5..1521134 100644
--- a/src/java/org/apache/fulcrum/jce/crypto/SmartDecryptingInputStream.java
+++ b/src/java/org/apache/fulcrum/jce/crypto/SmartDecryptingInputStream.java
@@ -44,6 +44,8 @@
*
* @param cryptoStreamFactory the CryptoStreamFactory for creating a cipher stream
* @param is the input stream to be decrypted
+ * @throws IOException if file not found
+ * @throws GeneralSecurityException if security check fails
*/
public SmartDecryptingInputStream(
CryptoStreamFactory cryptoStreamFactory,
@@ -59,6 +61,9 @@
* @param cryptoStreamFactory the CryptoStreamFactory for creating a cipher stream
* @param is the input stream to be decrypted
* @param password the password for decryption
+ *
+ * @throws IOException if file not found
+ * @throws GeneralSecurityException if security check fails
*/
public SmartDecryptingInputStream(
CryptoStreamFactory cryptoStreamFactory,
@@ -116,7 +121,7 @@
*
* @param content the data to be examined
* @return true if this is an encrypted file
- * @exception IOException unable to read the content
+ * @throws IOException unable to read the content
*/
private boolean isEncrypted( byte[] content )
throws IOException