public final class BGECPrivateKey extends sun.security.pkcs.PKCS8Key implements ECPrivateKey
EXPLICIT TAGS
ECPrivateKey ::= SEQUENCE {
version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1),
privateKey OCTET STRING,
parameters [0] ECDomainParameters {{ SECGCurveNames }} OPTIONAL,
publicKey [1] BIT STRING OPTIONAL
}
We currently ignore the optional parameters and publicKey fields. We
require that the parameters are encoded as part of the AlgorithmIdentifier,
not in the private key structure.
This class is a modified version of the ECPrivateKeyImpl class in the Sun library, designed to adapt to the SM2 algorithmsun.security.ec.ECPrivateKeyImpl,
序列化表格| 限定符和类型 | 字段和说明 |
|---|---|
private byte[] |
arrayS |
private ECParameterSpec |
params |
private BigInteger |
s |
private static long |
serialVersionUID |
private static int |
V1 |
private static int |
V2 |
| 构造器和说明 |
|---|
BGECPrivateKey(BigInteger s,
ECParameterSpec params)
Construct a key from its components.
|
BGECPrivateKey(byte[] encoded)
Construct a key from its encoding.
|
BGECPrivateKey(byte[] s,
ECParameterSpec params) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
decode(InputStream is) |
String |
getAlgorithm() |
byte[] |
getArrayS() |
ECParameterSpec |
getParams() |
BigInteger |
getS() |
private void |
makeEncoding(BigInteger s) |
private void |
makeEncoding(byte[] s) |
protected void |
parseKeyBits()
Parse the key.
|
decode, encode, encode, equals, getAlgorithmId, getEncoded, getFormat, hashCode, parse, parseKey, writeReplacegetEncoded, getFormatdestroy, isDestroyedprivate static final long serialVersionUID
private BigInteger s
private byte[] arrayS
private ECParameterSpec params
private static final int V1
private static final int V2
public BGECPrivateKey(byte[] encoded)
throws InvalidKeyException
public BGECPrivateKey(BigInteger s, ECParameterSpec params) throws InvalidKeyException
BGECPrivateKey(byte[] s,
ECParameterSpec params)
throws InvalidKeyException
private void makeEncoding(byte[] s)
throws InvalidKeyException
private void makeEncoding(BigInteger s) throws InvalidKeyException
public String getAlgorithm()
getAlgorithm 在接口中 KeygetAlgorithm 在类中 sun.security.pkcs.PKCS8Keypublic BigInteger getS()
getS 在接口中 ECPrivateKeypublic byte[] getArrayS()
public ECParameterSpec getParams()
protected void parseKeyBits()
throws InvalidKeyException
parseKeyBits 在类中 sun.security.pkcs.PKCS8KeyInvalidKeyExceptionpublic void decode(InputStream is) throws InvalidKeyException
decode 在类中 sun.security.pkcs.PKCS8KeyInvalidKeyExceptionCopyright © 2024. All rights reserved.