I am trying to sign data using Blackberry cryptography but generated signature is not getting verify by the server side(PHP)
I tried this -
RSACryptoSystem rsaCryptoSystem = new RSACryptoSystem(1024);
// Create an RSA key pair.
RSAKeyPair rsaKeyPair = new RSAKeyPair( rsaCryptoSystem );
// Create the necessary RSA key pair for signing and verifying.
RSACryptoSystem cryptoSystem = new RSACryptoSystem(1024);
RSAKeyPair keyPair = new RSAKeyPair( cryptoSystem );
// Create the digest and the salt value.
SHA1Digest digest = new SHA1Digest();
byte[] salt = RandomSource.getBytes( digest.getDigestLength() );
// Create the RSASignatureSigner passing in a digest algorithm
// and PSS signature formatter.
PSSSignatureSigner signer =
new PSSSignatureSigner( rsaKeyPair.getRSAPrivateKey(), digest, salt );
signer.update( stringToSign.getBytes() );
// Encode the signature using X509.
EncodedSignature encSignature = SignatureEncoder.encode( signer,"X509" );
String signedIdentifier = Base64.encode(encSignature.getEncodedSignature());
Please help
Change your code with