digital-signature
How to sign string with private key
I guess what you say is you know the key pair before hand and want to sign/verify with that. Please see the following code. import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.NoSuchAlgorithmException; import java.security.Signature; import sun.misc.BASE64Encoder; public class MainClass { public static void main(String[] args) throws Exception { KeyPair keyPair = getKeyPair(); byte[] data = “test”.getBytes(“UTF8”); Signature … Read more
openssl command line to verify the signature
I found two solutions to your problem. You can use rsautl that way: (with private key: my.key and public key my-pub.pem) $ openssl rsautl -sign -inkey my.key -out in.txt.rsa -in in.txt Enter pass phrase for my.key: $ openssl rsautl -verify -inkey my-pub.pem -in in.txt.rsa -pubin Bonjour With this method, all the document is included within … Read more
Correct way to sign and verify signature using bouncycastle
The gen.generate(msg, false) means the signed data is not encapsulated in the signature. This is fine if you want to create a detached signature, but it does mean that when you go to verify the SignedData you have to use the CMSSignedData constructor that takes a copy of the data as well – in this … Read more
Does anyone know a free(trial) timestamp server service? [closed]
You can try one of these publicly accessible RFC 3161 compliant time-stamping services: https://freetsa.org Supports HTTP, HTTPS and TCP transports and has other features http://time.certum.pl http://dse200.ncipher.com/TSS/HttpTspServer http://tsa.safecreative.org 5 free requests per day (may not be valid as root CA is ‘test’) – Safe Creative TSA is no longer active http://zeitstempel.dfn.de http://tsa.tecxoft.com Requires registration http://timestamp.comodoca.com/rfc3161 http://sha256timestamp.ws.symantec.com/sha256/timestamp … Read more
Difference between SHA256withRSA and SHA256 then RSA
The difference The difference between signing with “SHA256withRSA” and computing the SHA256 hash and signing it with “RSA” (= “NONEwithRSA”) is foremost that in the former case the calculated SHA-256 hash value is first encapsulated in a DigestInfo structure DigestInfo ::= SEQUENCE { digestAlgorithm DigestAlgorithm, digest OCTET STRING } before being padded and then encrypted … Read more
Verify a signature in JWT.IO
jwt.io says to enter the key Public Key or Certificate. Enter it in plain text only if you want to verify a token so I have converted the JSON Web Key to a PEM format guessing it would need a base64 format, and it works!. This is the public key built from modulus and exponent … Read more
RSA signature size?
You are right, the RSA signature size is dependent on the key size, the RSA signature size is equal to the length of the modulus in bytes. This means that for a “n bit key”, the resulting signature will be exactly n bits long. Although the computed signature value is not necessarily n bits, the … Read more
Understanding RSA signing for JWT
First off, apologies, this answer got rather long. If you use RSA to sign your tokens, and a connecting client is a web browser, the client will never see the RSA keys (public or private). This is because the client presumably doesn’t need to verify that the JWT is valid, only the server needs to … Read more
what is the difference between digital signature and digital certificate?
A digital signature is used to verify a message. It is basically an encrypted hash (encrypted by the private key of the sender) of the message. The recipient can check if the message was tampered with by hashing the received message and comparing this value with the decrypted signature. To decrypt the signature, the corresponding … Read more