Class KeyPairKey
java.lang.Object
zeroecho.core.alg.common.agreement.KeyPairKey
- All Implemented Interfaces:
Serializable, Key
A
Key wrapper that carries a KeyPair through APIs that are
constrained to Key types.
This type exists to support capabilities that require both private and public
components (e.g., message-oriented key agreement contexts), while preserving
backward-compatible capabilities that accept only a PrivateKey.
The wrapper does not expose an encoding via getEncoded() because
serializing private key material implicitly is dangerous and not required for
capability dispatch.
- Since:
- 1.0
- See Also:
-
Constructor Details
-
KeyPairKey
Creates a wrapper around aKeyPair.- Parameters:
keyPair- key pair to wrap (must not benull)- Throws:
NullPointerException- ifkeyPairisnull- Since:
- 1.0
-
-
Method Details
-
keyPair
-
privateKey
-
publicKey
-
getAlgorithm
Returns the algorithm name of the wrapped private key.- Specified by:
getAlgorithmin interfaceKey- Returns:
- algorithm name
- Since:
- 1.0
-
getFormat
-
getEncoded
public byte[] getEncoded()Returnsnull. This wrapper intentionally does not expose a combined encoding.- Specified by:
getEncodedin interfaceKey- Returns:
null- Since:
- 1.0
-