login about faq

Hi all,

i need to "translate" these lines writed in java. I dont' know what functions or assembly to use :

KeyStore keystore; // key repository for keys containing signature certificate
String alias; // alias for the certificate in the key repository
String password; // password for the certificate's private key
String plaintext; // text being signed

Signature signature = Signature.getInstance("SHA256withRSA"); signature.initSign((PrivateKey) keystore.getKey(alias, password.toCharArray())); signature.update(plaintext.getBytes("UTF-8")); byte[] rsa_text= signature.sign();

If someone can help me. I discover certificates and cryto. it is so new for me.

Thanks for your help.


asked Feb 19 '17 at 14:08

albator13's gravatar image


edited Feb 20 '17 at 09:45

chilkat's gravatar image

chilkat ♦♦

Here's an example:


If you need the RSA signature as bytes, the example creates the signature in a CkByteData object. Do the following to get the bytes:

byte[] rsa_text = binarySignature.getData();


answered Feb 20 '17 at 10:08

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Feb 19 '17 at 14:08

Seen: 1,346 times

Last updated: Feb 20 '17 at 10:08

powered by OSQA