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.

Eric

asked Feb 19 at 14:08

albator13's gravatar image

albator13
11

edited Feb 20 at 09:45

chilkat's gravatar image

chilkat ♦♦
12.8k317367485


Here's an example:

http://www.example-code.com/java/rsa_sha256_signature_using_java_keystore.asp

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();

link

answered Feb 20 at 10:08

chilkat's gravatar image

chilkat ♦♦
12.8k317367485

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×74
×54
×8

Asked: Feb 19 at 14:08

Seen: 605 times

Last updated: Feb 20 at 10:08

powered by OSQA