public final class SM2KeyAgreementParamSpec extends Object implements AlgorithmParameterSpec
Constructor and Description |
---|
SM2KeyAgreementParamSpec(byte[] id,
ECPrivateKey privateKey,
ECPublicKey publicKey,
byte[] peerId,
ECPublicKey peerPublicKey,
boolean isInitiator,
int sharedKeyLength)
Create a new
SM2KeyAgreementParamSpec . |
SM2KeyAgreementParamSpec(ECPrivateKey privateKey,
ECPublicKey publicKey,
ECPublicKey peerPublicKey,
boolean isInitiator,
int sharedKeyLength)
Create a new
SM2KeyAgreementParamSpec . |
Modifier and Type | Method and Description |
---|---|
byte[] |
id()
Returns the ID.
|
boolean |
isInitiator()
Indicates if it is initiator.
|
byte[] |
peerId()
Returns the peer's ID.
|
ECPublicKey |
peerPublicKey()
Returns the peer's public key.
|
ECPrivateKey |
privateKey()
Returns the private key.
|
ECPublicKey |
publicKey()
Returns the public key.
|
int |
sharedKeyLength()
Returns the length of the shared key.
|
public SM2KeyAgreementParamSpec(byte[] id, ECPrivateKey privateKey, ECPublicKey publicKey, byte[] peerId, ECPublicKey peerPublicKey, boolean isInitiator, int sharedKeyLength)
SM2KeyAgreementParamSpec
.id
- the ID.privateKey
- the private key.publicKey
- the public key.peerId
- the peer's ID.peerPublicKey
- the peer's public key.isInitiator
- true indicates it initiates the key exchanging;
false indicates peer initiates the key exchange.sharedKeyLength
- the length of the shared key.NullPointerException
- any parameter is null.public SM2KeyAgreementParamSpec(ECPrivateKey privateKey, ECPublicKey publicKey, ECPublicKey peerPublicKey, boolean isInitiator, int sharedKeyLength)
SM2KeyAgreementParamSpec
.
It just uses the default ID, exactly 1234567812345678
.privateKey
- the private key.publicKey
- the public key.peerPublicKey
- the peer's public key.isInitiator
- true indicates it initiates the key exchanging;
false indicates peer initiates the key exchange.sharedKeyLength
- the length of the shared key.NullPointerException
- any parameter is null.public byte[] id()
public ECPrivateKey privateKey()
public ECPublicKey publicKey()
public byte[] peerId()
public ECPublicKey peerPublicKey()
public boolean isInitiator()
public int sharedKeyLength()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2024, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.