我正在尝试集成 Amazon Pay 以接收商家付款,并且我看到了一个接收 preSharedEncodedKey 的方法。但是我在文档中的任何地方都找不到那个键。我在哪里可以找到它?
在 [2019 年 1 月 22 日 Amazon Pay 集成指南 26] 中有提及
private static byte[] encryptMerchantKey(final byte[] key) throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException, BadPaddingException, IllegalBlockSizeException
{
KeyFactory keyFact = KeyFactory.getInstance(RSA);
KeySpec spec = new X509EncodedKeySpec(org.bouncycastle.util.encoders.Base64.decode("preSharedEncodedKey"));
PublicKey publicKey = keyFact.generatePublic(spec);
Cipher cipher = RSA_THREAD_CIPHER.get();
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
return cipher.doFinal(key);
}
论坛主题:https ://forums.aws.amazon.com/thread.jspa?threadID=104446