|
@ -608,14 +608,16 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
|
|
|
|
|
|
@RequestMapping(value = "/oauth/getHwlyyPublicKey", method = RequestMethod.GET)
|
|
|
public ObjEnvelop getHwlyyPublicKey(){
|
|
|
// KeyPair keyPair = com.yihu.jw.security.utils.RSAUtils.getKey();
|
|
|
// byte[] bytekey = SerializeUtil.ObjTOSerialize(keyPair);
|
|
|
// KeyPair key = (KeyPair)SerializeUtil.unSerialize(bytekey);
|
|
|
// OauthKeypairDO keypairDO = new OauthKeypairDO();
|
|
|
// keypairDO.setCode("hwlyyKey");
|
|
|
// keypairDO.setKeyPair(bytekey);
|
|
|
// oauthKeypairDao.save(keypairDO);
|
|
|
|
|
|
OauthKeypairDO keypairDO = oauthKeypairDao.findByCode("hwlyyKey");
|
|
|
if(keypairDO==null){
|
|
|
KeyPair keyPair = com.yihu.jw.security.utils.RSAUtils.getKey();
|
|
|
byte[] bytekey = SerializeUtil.ObjTOSerialize(keyPair);
|
|
|
OauthKeypairDO kpDO = new OauthKeypairDO();
|
|
|
kpDO.setCode("hwlyyKey");
|
|
|
kpDO.setKeyPair(bytekey);
|
|
|
keypairDO = oauthKeypairDao.save(kpDO);
|
|
|
}
|
|
|
KeyPair key = (KeyPair)SerializeUtil.unSerialize(keypairDO.getKeyPair());
|
|
|
PublickeyVO pk = new PublickeyVO();
|
|
|
pk.setPublicKey(com.yihu.jw.security.utils.RSAUtils.generateBase64PublicKey(key));
|