/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public class TimestampCheck {
int len = 0;
if (h.equalsIgnoreCase("Content-length")) {
}
}
try {
int path = 0;
}
} catch (Exception e) {
e.printStackTrace();
}
t.close();
}
/**
* @param input The data to sign
* @param path different cases to simulate, impl on URL path
* 0: normal
* 1: Missing nonce
* 2: Different nonce
* 3: Bad digets octets in messageImprint
* 4: Different algorithmId in messageImprint
* 5: whole chain in cert set
* 6: extension is missing
* 7: extension is non-critical
* 8: extension does not have timestamping
* @returns the signed
*/
// Read TSRequest
nonce = v.getBigInteger();
}
}
// Write TSResponse
}
} else if (path == 9) {
} else {
}
} else {
if (path == 4) {
} else {
}
}
if (path == 2) {
} else if (path == 1) {
// do nothing
} else {
}
"1.2.840.113549.1.9.16.1.4"),
.getIssuerX500Principal().getName()));
return out.toByteArray();
}
}
// Use -J-Djava.security.egd=file:/dev/./urandom to speed up
// nonce generation in timestamping request. Not avaibale on
// Windows and defaults to thread seed generator, not too bad.
" -J-Djava.security.egd=file:/dev/./urandom" +
} else {
" -J-Djava.security.egd=file:/dev/./urandom" +
}
try {
} else { // Run as a standalone server
}
} finally {
}
}
/**
* @param cmd the command line (with a hole to plug in)
* @param path the path in the URL, i.e, http://localhost/path
* @param expected if this command should succeed
*/
throws Exception {
new InputStreamReader(p.getErrorStream()));
while (true) {
if (s == null) break;
}
throw new Exception("Failed");
}
}
}