public class AsymmetricCryptoKeyPair
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static MyDSAPrivateKey |
dsaKey |
private static MyECPrivateKey |
ecKey |
static int |
KEY_LENGTH_1024 |
static int |
KEY_LENGTH_512 |
private IMyPrivateKey |
m_privateKey |
private IMyPublicKey |
m_publicKey |
private static java.util.Vector |
ms_privateKeyClasses
Stores all registered private key classes.
|
private static java.util.Vector |
ms_publicKeyClasses
Stores all registered public key classes.
|
private static MyRSAPrivateKey |
rsaKey |
Constructor and Description |
---|
AsymmetricCryptoKeyPair(IMyPrivateKey a_privateKey)
Creates a new key pair from a private key.
|
AsymmetricCryptoKeyPair(mybouncycastle.org.bouncycastle.asn1.pkcs.PrivateKeyInfo a_keyInfo)
Creates a new key pair from a PrivateKeyInfo.
|
Modifier and Type | Method and Description |
---|---|
private static java.security.Key |
createAsymmetricCryptoKey(java.lang.Object a_keyInfo,
java.util.Enumeration a_keyClasses) |
static IMyPublicKey |
createPublicKey(mybouncycastle.org.bouncycastle.asn1.x509.SubjectPublicKeyInfo a_keyInfo)
Creates a new public key from a SubjectPublicKeyInfo.
|
IMyPrivateKey |
getPrivate()
Returns the private key.
|
private static java.util.Enumeration |
getPrivateKeyClasses()
Returns all registered private key classes.
|
IMyPublicKey |
getPublic()
Returns the public key.
|
private static java.util.Enumeration |
getPublicKeyClasses()
Returns all registered public key classes.
|
protected static boolean |
isValidKeyPair(AsymmetricCryptoKeyPair a_keyPair)
Tests if a given key pair is a valid key pair.
|
public static final int KEY_LENGTH_512
public static final int KEY_LENGTH_1024
private static final MyDSAPrivateKey dsaKey
private static final MyRSAPrivateKey rsaKey
private static final MyECPrivateKey ecKey
private static java.util.Vector ms_privateKeyClasses
private static java.util.Vector ms_publicKeyClasses
private IMyPrivateKey m_privateKey
private IMyPublicKey m_publicKey
public AsymmetricCryptoKeyPair(IMyPrivateKey a_privateKey)
a_privateKey
- a private keypublic AsymmetricCryptoKeyPair(mybouncycastle.org.bouncycastle.asn1.pkcs.PrivateKeyInfo a_keyInfo) throws java.security.InvalidKeyException
a_keyInfo
- a PrivateKeyInfo objectjava.security.InvalidKeyException
- if no private key could be created from this key infoIMyPrivateKey
,
ClassUtil.loadClasses()
public static final IMyPublicKey createPublicKey(mybouncycastle.org.bouncycastle.asn1.x509.SubjectPublicKeyInfo a_keyInfo) throws java.security.InvalidKeyException
a_keyInfo
- a SubjectPublicKeyInfo describing a public keyjava.security.InvalidKeyException
- if no public key could be created from this key infoClassUtil.loadClasses()
,
IMyPublicKey
public final IMyPrivateKey getPrivate()
public final IMyPublicKey getPublic()
protected static final boolean isValidKeyPair(AsymmetricCryptoKeyPair a_keyPair)
a_keyPair
- an AsymmetricKeyPairprivate static java.security.Key createAsymmetricCryptoKey(java.lang.Object a_keyInfo, java.util.Enumeration a_keyClasses) throws java.security.InvalidKeyException
java.security.InvalidKeyException
private static java.util.Enumeration getPrivateKeyClasses()
ClassUtil.loadClasses()
,
IMyPrivateKey
private static java.util.Enumeration getPublicKeyClasses()
ClassUtil.loadClasses()
,
IMyPublicKey
Copyright © 2023. All rights reserved.