Top Fields Constructors Methods
org.bouncycastle.openssl.jcajce

public Class JcaPEMKeyConverter

extends Object
Class Inheritance
Imports
java.security.KeyFactory, .KeyPair, .NoSuchAlgorithmException, .NoSuchProviderException, .PrivateKey, .Provider, .PublicKey, java.security.spec.PKCS8EncodedKeySpec, .X509EncodedKeySpec, java.util.HashMap, .Map, org.bouncycastle.asn1.ASN1ObjectIdentifier, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, .PrivateKeyInfo, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .SubjectPublicKeyInfo, org.bouncycastle.asn1.x9.X9ObjectIdentifiers, org.bouncycastle.jcajce.util.DefaultJcaJceHelper, .JcaJceHelper, .NamedJcaJceHelper, .ProviderJcaJceHelper, org.bouncycastle.openssl.PEMException, .PEMKeyPair

Field Summary

Modifier and TypeField and Description
private final Map<K, V>
private static final Map<K, V>
private JcaJceHelper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private KeyFactory
public KeyPair

Returns:

the result of the conversion
getKeyPair
(PEMKeyPair
the PEMKeyPair to be converted.
keyPair
)

Convert a PEMKeyPair into a KeyPair, returning the converted result.

public PrivateKey
getPrivateKey(PrivateKeyInfo privateKeyInfo)

public PublicKey
public JcaPEMKeyConverter

Returns:

the current builder instance.
setAlgorithmMapping
(ASN1ObjectIdentifier
object identifier used to identify the public/private key
algOid
,
String
algorithm name we want to map to in the provider.
algorithmName
)

Set the algorithm mapping for a particular OID to the given algorithm name.

public JcaPEMKeyConverter
public JcaPEMKeyConverter
setProvider(String providerName)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

algorithmsback to summary
private final Map<K, V> algorithms
baseMappingsback to summary
private static final Map<K, V> baseMappings
helperback to summary
private JcaJceHelper helper

Constructor Detail

JcaPEMKeyConverterback to summary
public JcaPEMKeyConverter()

Method Detail

getKeyFactoryback to summary
private KeyFactory getKeyFactory(AlgorithmIdentifier algId) throws NoSuchAlgorithmException, NoSuchProviderException
getKeyPairback to summary
public KeyPair getKeyPair(PEMKeyPair keyPair) throws PEMException

Convert a PEMKeyPair into a KeyPair, returning the converted result.

Parameters
keyPair:PEMKeyPair

the PEMKeyPair to be converted.

Returns:KeyPair

the result of the conversion

Exceptions
PEMException:
if an exception is thrown attempting to do the conversion.
getPrivateKeyback to summary
public PrivateKey getPrivateKey(PrivateKeyInfo privateKeyInfo) throws PEMException
getPublicKeyback to summary
public PublicKey getPublicKey(SubjectPublicKeyInfo publicKeyInfo) throws PEMException
setAlgorithmMappingback to summary
public JcaPEMKeyConverter setAlgorithmMapping(ASN1ObjectIdentifier algOid, String algorithmName)

Set the algorithm mapping for a particular OID to the given algorithm name.

Parameters
algOid:ASN1ObjectIdentifier

object identifier used to identify the public/private key

algorithmName:String

algorithm name we want to map to in the provider.

Returns:JcaPEMKeyConverter

the current builder instance.

setProviderback to summary
public JcaPEMKeyConverter setProvider(Provider provider)
setProviderback to summary
public JcaPEMKeyConverter setProvider(String providerName)