Top Description Fields Constructors Methods
org.bouncycastle.crypto.asymmetric

public final Class AsymmetricKeyPair<P extends AsymmetricPublicKey, S extends AsymmetricPrivateKey>

extends Object
Class Inheritance
Imports
java.math.BigInteger, java.security.AccessController, .PrivilegedAction, org.bouncycastle.crypto.AsymmetricPrivateKey, .AsymmetricPublicKey, org.bouncycastle.util.Arrays

Carrier class for a public key and its associated private key. This class will check the key pair on construction.

Field Summary

Modifier and TypeField and Description
private final S
private final P

Constructor Summary

AccessConstructor and Description
public
AsymmetricKeyPair(final P
the public key component.
publicKey
,
final S
the private key component.
privateKey
)

Create a public/private key pair.

Method Summary

Modifier and TypeMethod and Description
private void
checkKeyPairForConsistency(P publicKey, S privateKey)

public S

Returns:

the private key.
getPrivateKey
()

Return the private key of the pair.

public P

Returns:

the public key.
getPublicKey
()

Return the public key of the pair.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

privateKeyback to summary
private final S privateKey
publicKeyback to summary
private final P publicKey

Constructor Detail

AsymmetricKeyPairback to summary
public AsymmetricKeyPair(final P publicKey, final S privateKey)

Create a public/private key pair.

Parameters
publicKey:P

the public key component.

privateKey:S

the private key component.

Exceptions
IllegalArgumentException:
if the public and private key arguments are inconsistent.

Method Detail

checkKeyPairForConsistencyback to summary
private void checkKeyPairForConsistency(P publicKey, S privateKey)
getPrivateKeyback to summary
public S getPrivateKey()

Return the private key of the pair.

Returns:S

the private key.

getPublicKeyback to summary
public P getPublicKey()

Return the public key of the pair.

Returns:P

the public key.