Hi,

  How world can see the document. what was the problem in the code?

  Please correct me if I am understanding it wrongly.

 If i encrypt the document with certificate(private key) then how user
decrypt it?
 If i share public key, how user will decrypt it? Do i need to provide the
utility/web access  to do this job. it is not possible in my environment.

what is the best certificate encryption algorithm to follow?







On Mon, Oct 21, 2013 at 4:13 PM, iText Info <i...@1t3xt.info> wrote:

> Is it possible you're confusing encryption with signing?
>
> Your initial question was about encryption, which means you want to
> secure a document so that it's protected against people who may not know
> the content of the document.
> Your code shows that you're signing a document, which means that you
> want the whole world to see the document, but you want to assure its
> integrity, authenticity and non-repudiation.
>
> Those are two different things, aren't they?
>
> Op 21/10/2013 9:42, Bapuji Nakka schreef:
> > Hi,
> >
> >      Thanks for your help. Iam using
> >
> >         Security.addProvider(new BouncyCastleProvider());
> >          KeyStore ks = KeyStore.getInstance("pkcs12", "BC");
> >          ks.load(new FileInputStream(cert), certpass);
> >          String alias = (String)ks.aliases().nextElement();
> >          PrivateKey pk = (PrivateKey)ks.getKey(alias, certpass);
> >          Certificate[] chain = ks.getCertificateChain(alias);
> >
> >
> >          ExternalSignature es = new PrivateKeySignature(pk, "SHA-256",
> > "BC");
> >          ExternalDigest digest = new BouncyCastleDigest();
> >          MakeSignature.signDetached(appearance, digest, es, chain, null,
> > null, null, 0, MakeSignature.CryptoStandard.CMS);
> >
> >
> >     Generated 2046 bit key with openssl*
> >     openssl genrsa -des3 -out keys/ca.key 2046*
> >
> >
> > On Mon, Oct 21, 2013 at 11:41 AM, iText mailing list <i...@1t3xt.info
> > <mailto:i...@1t3xt.info>> wrote:
> >
> >     On 10/21/2013 8:03 AM, Bapuji Nakka wrote:
> >      > I am using AES 256 bit encryption. Is this secure from bruit
> >     force attack?
> >      >    Because i read in articles, above encryption can be cracked
> >     easlily
> >      > in the adobe 9.
> >     This question is wrong.
> >     It should read: "Is password encryption secure?" The answer is "No!"
> >     A follow-up question would be: "Then how do I securely encrypt a
> PDF?"
> >     The answer is: "Use certificate encryption?"
> >     A follow-up question to that question could be: "Is certificate
> >     encryption ALWAYS secure?"
> >     The answer is: that depends on the encryption algorithm and the
> length
> >     of the key that is used.
> >
> >
> ------------------------------------------------------------------------------
> >     October Webinars: Code for Performance
> >     Free Intel webinars can help you accelerate application performance.
> >     Explore tips for MPI, OpenMP, advanced profiling, and more. Get the
> >     most from
> >     the latest Intel processors and coprocessors. See abstracts and
> >     register >
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
> >     _______________________________________________
> >     iText-questions mailing list
> >     iText-questions@lists.sourceforge.net
> >     <mailto:iText-questions@lists.sourceforge.net>
> >     https://lists.sourceforge.net/lists/listinfo/itext-questions
> >
> >     iText(R) is a registered trademark of 1T3XT BVBA.
> >     Many questions posted to this list can (and will) be answered with a
> >     reference to the iText book: http://www.itextpdf.com/book/
> >     Please check the keywords list before you ask for examples:
> >     http://itextpdf.com/themes/keywords.php
> >
> >
> >
> >
> > --
> > Regards,
> > Bapuji.Nakka | Scientific Officer
> > NIC | New Delhi | INDIA
> > Contact : 011 24101764 Ext : 614
> > Mobile : +91 9650 814813
> > Email : bapuji.na...@yahoo.co.in <mailto:bapuji.na...@yahoo.co.in>
> >
> >
> >
> ------------------------------------------------------------------------------
> > October Webinars: Code for Performance
> > Free Intel webinars can help you accelerate application performance.
> > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
> from
> > the latest Intel processors and coprocessors. See abstracts and register
> >
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
> >
> >
> >
> > _______________________________________________
> > iText-questions mailing list
> > iText-questions@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
> >
> > iText(R) is a registered trademark of 1T3XT BVBA.
> > Many questions posted to this list can (and will) be answered with a
> reference to the iText book: http://www.itextpdf.com/book/
> > Please check the keywords list before you ask for examples:
> http://itextpdf.com/themes/keywords.php
> >
>
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
> from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> iText(R) is a registered trademark of 1T3XT BVBA.
> Many questions posted to this list can (and will) be answered with a
> reference to the iText book: http://www.itextpdf.com/book/
> Please check the keywords list before you ask for examples:
> http://itextpdf.com/themes/keywords.php
>



-- 
Regards,
Bapuji.Nakka | Scientific Officer
NIC | New Delhi | INDIA
Contact : 011 24101764 Ext : 614
Mobile : +91 9650 814813
Email : bapuji.na...@yahoo.co.in
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to