2
我嘗試登錄使用黑莓手機加密數據,但生成的簽名是沒有得到通過服務器端驗證(PHP)如何使用黑莓的加密
籤數據我想這一點 -
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());
請幫助
什麼'cryptoSystem'和'keyPair'用於更改您的密碼?看起來你只是在創建重複的變量。 – Nate