Can anybody give me an example to encrypt xml with private key?
--
http://sourceforge.net/projects/mycodeline/
http://rubyforge.org/projects/ropenwiki/
tion in
> http://xml.apache.org/security/dist/java-library/)
>
> huang zhimin ha scritto:
> > Can anybody give me an example to encrypt xml with private key?
> >
> > --
> > http://sourceforge.net/projects/mycodeline/
> > http://rubyforge.org/projects/ropenw
. You can find them at
> SUN java site http://java.sun.com, in the section of jdk downloads.
> Choose the proper file for your version of jdk.
>
>
> huang zhimin ha scritto:
> > public void encrypt(Document document) throws Exception {
> > KeyStore ks = getK
public void encrypt(Document document) throws Exception {
KeyStore ks = getKeyStore();
X509Certificate certificate = getCertificate(ks);
String algorithmURI = XMLCipher.SHA256;
Element rootElement = document.getDocumentElement();
XMLCipher xmlCipher = XMLCi
I tried several times, but always failed. Can anybody give me an example
about how to encrypt xml with public certificate key?
--
http://sourceforge.net/projects/mycodeline/
http://rubyforge.org/projects/ropenwiki/
I tried several times, but always failed. Can anybody give me an example
about how to encrypt xml with public certificate key?
--
http://sourceforge.net/projects/mycodeline/
http://rubyforge.org/projects/ropenwiki/
The code is similar to the samples given by CreateSignature.java and
VerifySignature.java. When I run the code in the same machine, verifying is
successful. But if I put the code on two machines, one to create signature,
the other to verify, verifying is failed for *Verification failed for URI ""
*
I use BouncyCastleProvider to get a private key from a p12 file, when i use
the private key to encrypt xml document, i get the exception as follows:
org.apache.xml.security.signature.XMLSignatureException: No installed
provider supports this key:
org.bouncycastle.jce.provider.JCERSAPrivateCrtKey
O
wrote:
> >> Why would you want to encrypt with a private key? Anyone with the
> >> corresponding public key (which is, after all, public) can decrypt the
> >> message, rendering the encryption useless.
> >>
> >>
> ---