-
August 15th, 2018, 03:00 AM
#1
Using Bouncy Castle to sign with RSASSA-PSS
I want sign a Certificate Signing Request with PSS, but I am not sure how to do.
I am not sure if it is correct what I did, but can someone say to me how I combine the created signature with a Certificate Signing Request?
Code:
public byte[] CreateSignature(byte[] message, AsymmetricKeyParameter privateKey)
{
PssSigner signer = new PssSigner(new RsaEngine(), new Sha512Digest());
signer.Init(true, new ParametersWithRandom((RsaPrivateCrtKeyParameters) privateKey));
signer.BlockUpdate(message, 0, message.Length);
byte[] signature = signer.GenerateSignature(); //generation of signature
return signature;
}
Message is here the Certificate Signing Request.
PrivateKey, of course, the Private Key of the Certificate Signing Request.
Sorry, the code is written in C# but I am sure it is nearly the same in Java.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|