I want to know can symmetric keys be used to sign a message ? We can encrpyt using the shared secret key. Also when symmetric key is used for signing , what API can be used in J
A shared secret key can be used to calculate a Message Authentication Code (MAC), which then can be used to confirm the integrity and authenticity of the message to another party which knows the same shared secret. Unlike digital signatures, which are created using the private key and verified using the public key, MACs do not offer non-repudiation (anyone who can verify the MAC can also generate a MAC for another message).
There are different forms of message authentication codes; probably the most often used variation is HMAC.