|
From: <php...@li...> - 2009-12-10 09:14:52
|
Hi,
I got a error when I call 'getOCSPURL' with the certificate.
$url = java("com.lowagie.text.pdf.PdfPKCS7")->getOCSPURL($chain[0]);
I know $chain[0] contain a valid X509CertificateObject, but I always got that exception:
#0 C:\Developpement\My Webs\ss_billing\JavaBridge\java\Java.inc(248): java_ThrowExceptionProxyFactory->getProxy(102, 'org.bouncycastl...', '', true)
#1 C:\Developpement\My Webs\ss_billing\JavaBridge\java\Java.inc(388): java_Arg->getResult(true)
#2 C:\Developpement\My Webs\ss_billing\JavaBridge\java\Java.inc(394): java_Client->getWrappedResult(true)
#3 C:\Developpement\My Webs\ss_billing\JavaBridge\java\Java.inc(594): java_Client->getResult()
#4 C:\Developpement\My Webs\ss_billing\JavaBridge\java\Java.inc(1731): java_Client->invokeMethod(100, 'getOCSPURL', Array)
#5 C:\Developpement\My Webs\ss_billing\JavaBridge\java\Java.inc(1839): java_JavaProxy->__call('getOCSPURL', Array)
#6 C:\Developpement\My Webs\ss_billing\JavaBridge\java\Java.inc(2007): java_AbstractJava->__call('getOCSPURL', Array)
#7 [internal function]: Java->__call('getOCSPURL', Array)
#8 C:\Developpement\My Webs\ss_billing\classes\billing.class2.pdf.php(349): JavaClass->getOCSPURL(Object(java_InternalJava))
#9 C:\Developpement\My Webs\ss_billing\receive.php(183): billing_pdf::generation(Object(SimpleXMLElement))
#10 {main}
I'm using iText-2.1.7.jar and some other functionality of this library are working fine... any idea ?
> Date: Mon, 7 Dec 2009 11:47:44 +0100
> To: php...@li...
> From: php...@li...
> Subject: Re: [Php-java-bridge-users] messageDigest and byte manipulation(2)
>
> 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
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
_________________________________________________________________
Faites vos achats de Noël en ligne en toute sécurité : avec MSN Internet Explorer 8 surfez sûr, télécharger maintenant gratuitement !
http://www.microsoft.ch/msnie8/fr
|