Skip to content
Advertisement

How to send and receive a DSA public/private signed message in Java

I cannot find any good (complete) documentation on how to exchange a public/private key signed message in Java.

I have yet to find a concise document on the minimum steps needed to generate a public key and private key using DSA, sign a byte[], and verify it.

The documentation from Oracle is too broken up and requires running across multiple JVMs.

Advertisement

Answer

I have successfully signed a byte array with a private key and verified it with a public key.

Example.

JavaScript

In this version, I serialize the public key into a byte array and then create a PublicKey from that byte array.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement