关键:(1)Java支持NoPadding填充方式,并且已经封装好相应的接口,可通过Cipher.getInstance来指定RSA/ECB/NoPadding该对齐和填充方式;
(2)Golang中不支持NoPadding的填充方式,只能通过以下方式来处理:
c := new(big.Int).SetBytes(cipherText)
plainText := c.Exp(c, privateKey.D, privateKey.N).Bytes()
关键:(1)Java支持NoPadding填充方式,并且已经封装好相应的接口,可通过Cipher.getInstance来指定RSA/ECB/NoPadding该对齐和填充方式;
(2)Golang中不支持NoPadding的填充方式,只能通过以下方式来处理:
c := new(big.Int).SetBytes(cipherText)
plainText := c.Exp(c, privateKey.D, privateKey.N).Bytes()