Ejemplo n.º 1
0
        /**
         * Returns the engine digest length in bytes. If the implementation does not
         * implement this function or is not an instance of {@code Cloneable},
         * {@code 0} is returned.
         *
         * @return the digest length in bytes, or {@code 0}
         */
        public int getDigestLength()
        {
            int l = engineGetDigestLength();

            if (l != 0)
            {
                return(l);
            }
            if (!(this is java.lang.Cloneable))
            {
                return(0);
            }
            try
            {
                MessageDigest md = (MessageDigest)clone();
                return(md.digest().Length);
            }
            catch (java.lang.CloneNotSupportedException)
            {
                return(0);
            }
        }