引用maven包
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.72</version>
</dependency>
2.对报文进行加密后生成签名
{
String encryptedContent=AesUtil.encryptMsgStr(oristr, SECRET_KEY);
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC", "BC");
keyGen.initialize(256);
KeyPair keyPair = keyGen.generateKeyPair();
PrivateKey privateKey = keyPair.getPrivate();
PublicKey publicKey = keyPair.getPublic();
String privateKeyHex = CodecUtil.encodeBase64(privateKey.getEncoded());
String publicKeyGex=CodecUtil