public class SM2Factory extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private static BigInteger |
a |
private static BigInteger |
b |
org.bouncycastle.crypto.params.ECDomainParameters |
ecc_bc_spec |
org.bouncycastle.math.ec.ECCurve |
ecc_curve |
org.bouncycastle.math.ec.ECFieldElement |
ecc_gx_fieldelement |
org.bouncycastle.math.ec.ECFieldElement |
ecc_gy_fieldelement |
org.bouncycastle.crypto.generators.ECKeyPairGenerator |
ecc_key_pair_generator |
org.bouncycastle.math.ec.ECPoint |
ecc_point_g |
private static BigInteger |
gx |
private static BigInteger |
gy |
private static int |
h |
private static BigInteger |
n |
private static BigInteger |
p |
| 构造器和说明 |
|---|
SM2Factory() |
| 限定符和类型 | 方法和说明 |
|---|---|
static SM2Factory |
getInstance()
初始化方法
|
byte[] |
sm2GetZ(byte[] userId,
org.bouncycastle.math.ec.ECPoint userKey)
根据私钥、曲线参数计算Z
|
void |
sm2Sign(byte[] md,
BigInteger userD,
org.bouncycastle.math.ec.ECPoint userKey,
SM2Result sm2Result)
签名相关值计算
|
void |
sm2Verify(byte[] md,
org.bouncycastle.math.ec.ECPoint userKey,
BigInteger r,
BigInteger s,
SM2Result sm2Result)
验签
|
private static final BigInteger a
private static final BigInteger b
private static final BigInteger gx
private static final BigInteger gy
private static final BigInteger n
private static final BigInteger p
private static final int h
public final org.bouncycastle.math.ec.ECFieldElement ecc_gx_fieldelement
public final org.bouncycastle.math.ec.ECFieldElement ecc_gy_fieldelement
public final org.bouncycastle.math.ec.ECCurve ecc_curve
public final org.bouncycastle.math.ec.ECPoint ecc_point_g
public final org.bouncycastle.crypto.params.ECDomainParameters ecc_bc_spec
public final org.bouncycastle.crypto.generators.ECKeyPairGenerator ecc_key_pair_generator
public static SM2Factory getInstance()
public byte[] sm2GetZ(byte[] userId,
org.bouncycastle.math.ec.ECPoint userKey)
userId - userKey - public void sm2Sign(byte[] md,
BigInteger userD,
org.bouncycastle.math.ec.ECPoint userKey,
SM2Result sm2Result)
md - userD - userKey - sm2Result - public void sm2Verify(byte[] md,
org.bouncycastle.math.ec.ECPoint userKey,
BigInteger r,
BigInteger s,
SM2Result sm2Result)
md - sm3摘要userKey - 根据公钥decode一个ecpoint对象r - 没有特殊含义s - 没有特殊含义sm2Result - 接收参数的对象Copyright © 2024. All rights reserved.