|
From: <php...@li...> - 2009-12-07 10:47:56
|
Hi,
[java-code]
Certificate[] chain = ks.getCertificateChain(alias);
if (chain.length >= 2) {
String url = PdfPKCS7.getOCSPURL((
>
> X509Certificate)chain[0]);
> if (url != null && url.length() > 0)
> ocsp = new OcspClientBouncyCastle((X509Certificate)chain[0],
> (X509Certificate)chain[1], url).getEncoded();
> }
=>
$chain = $ks->getCertificateChain($alias);
if (java_values(chain.length)) >= 2) {
$url = java("...PdfPKCS7")->getOCSPURL($chain[0]);
if (java_values($url) != null && java_values($url->length()) > 0) {
$val = new java("...OcspClientBouncyCastle", $chain[0], $chain[1],
$url);
$ocsp = $val->getEncoded();
}
Where exactly are the problems?
You can always use
echo java_inspect($jobject)
to see if a Java method or procedure invocation has returned the correct
result.
However, it isn't possible to blindly convert a Java program to PHP. PHP has
different type conversion rules for example.
If you have a working java library, just add it to your web context and call
it from PHP.
Regards,
Jost Boekemeier
|