public class SM2 extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
SM2.Signature |
| 限定符和类型 | 字段和说明 |
|---|---|
static org.bouncycastle.math.ec.ECCurve.Fp |
curve |
static org.bouncycastle.math.ec.ECPoint |
G |
| 构造器和说明 |
|---|
SM2() |
| 限定符和类型 | 方法和说明 |
|---|---|
static BigInteger |
bigIntegerPreHandle(BigInteger bigInteger) |
SM2KeyPair |
generateKeyPair()
生成密钥对
|
static byte[] |
getRawPubKey(org.bouncycastle.math.ec.ECPoint pubKey) |
static byte[] |
getRawPubKey(SM2KeyPair sm2KeyPair) |
static byte[] |
getRawSkey(SM2KeyPair sm2KeyPair) |
static SM2KeyPair |
getSM2KeyPair() |
static SM2.Signature |
sign(String M,
String IDA,
SM2KeyPair keyPair)
签名
|
static byte[] |
signWithBytes(String M,
String IDA,
SM2KeyPair keyPair)
签名
|
static boolean |
verify(byte[] msg,
byte[] sign,
KeyMember member) |
static boolean |
verify(String M,
byte[] signature,
String IDA,
org.bouncycastle.math.ec.ECPoint aPublicKey)
验签
|
static boolean |
verify(String M,
SM2.Signature signature,
String IDA,
org.bouncycastle.math.ec.ECPoint aPublicKey)
验签
|
public static org.bouncycastle.math.ec.ECCurve.Fp curve
public static org.bouncycastle.math.ec.ECPoint G
public SM2KeyPair generateKeyPair()
public static SM2.Signature sign(String M, String IDA, SM2KeyPair keyPair) throws UnsupportedEncodingException
M - 签名信息IDA - 签名方唯一标识keyPair - 签名方密钥对UnsupportedEncodingExceptionpublic static byte[] signWithBytes(String M, String IDA, SM2KeyPair keyPair) throws UnsupportedEncodingException
M - 签名信息IDA - 签名方唯一标识keyPair - 签名方密钥对UnsupportedEncodingExceptionpublic static boolean verify(String M, SM2.Signature signature, String IDA, org.bouncycastle.math.ec.ECPoint aPublicKey) throws UnsupportedEncodingException
M - 签名信息signature - 签名IDA - 签名方唯一标识aPublicKey - 签名方公钥UnsupportedEncodingExceptionpublic static boolean verify(String M, byte[] signature, String IDA, org.bouncycastle.math.ec.ECPoint aPublicKey) throws UnsupportedEncodingException
M - 签名信息signature - 签名IDA - 签名方唯一标识aPublicKey - 签名方公钥UnsupportedEncodingExceptionpublic static boolean verify(byte[] msg,
byte[] sign,
KeyMember member)
throws UnsupportedEncodingException
public static BigInteger bigIntegerPreHandle(BigInteger bigInteger)
public static byte[] getRawPubKey(org.bouncycastle.math.ec.ECPoint pubKey)
public static SM2KeyPair getSM2KeyPair()
public static byte[] getRawSkey(SM2KeyPair sm2KeyPair)
public static byte[] getRawPubKey(SM2KeyPair sm2KeyPair)
Copyright © 2025. All rights reserved.