Closed GyuriMajercsik closed 2 years ago
I posted a stackoverflow question as well: https://stackoverflow.com/questions/67840150/sha-384-pss-signature-verification-using-pointycastle-in-dart
Hey, sorry for my late answer. Pointy Castle is the dart implementation of bouncy castle, which has been around for quite some time now. So maybe it helps to search for your answer. This is at least how I searched during the development process of crypton.
Anyways maybe this link helps. https://www.programcreek.com/java-api-examples/?api=org.bouncycastle.crypto.signers.PSSSigner
Thank you for your input. Unfortunately, it seems to be a different approach in BouncyCastle ( or at least in the link you sent ). They initialise the signer directly with the public key, without specifying the salt, as seen below. In PointyCastle there are two options: ParametersWithSalt
or ParametersWithSaltConfiguration
. The second is for signing purposes and the first requires a salt ...
if (forSigning) {
pss.init(true, PrivateKeyFactory.createKey(key));
} else {
pss.init(false, PublicKeyFactory.createKey(key));
}
I am investigating on how I could do this using
crypton
but it seems there is no support for that, yet.Although I managed to use directly
pointycastle
but somehow I stuck on creating thesalt
...Basically, I have a public key, a message and a signature and I would verify that the signature matches the message using the public key.
I'm not sure how to build `ParametersWithSalt(keyParams, Uint8List()' needed to initialise the signer.
Any hint is highly appreciated.