Class JcaPEMKeyConverter


  • public class JcaPEMKeyConverter
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.security.KeyPair getKeyPair​(PEMKeyPair keyPair)
      Convert a PEMKeyPair into a KeyPair, returning the converted result.
      java.security.PrivateKey getPrivateKey​(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privateKeyInfo)  
      java.security.PublicKey getPublicKey​(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo publicKeyInfo)  
      JcaPEMKeyConverter setAlgorithmMapping​(org.bouncycastle.asn1.ASN1ObjectIdentifier algOid, java.lang.String algorithmName)
      Set the algorithm mapping for a particular OID to the given algorithm name.
      JcaPEMKeyConverter setProvider​(java.lang.String providerName)  
      JcaPEMKeyConverter setProvider​(java.security.Provider provider)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JcaPEMKeyConverter

        public JcaPEMKeyConverter()
    • Method Detail

      • setProvider

        public JcaPEMKeyConverter setProvider​(java.security.Provider provider)
      • setAlgorithmMapping

        public JcaPEMKeyConverter setAlgorithmMapping​(org.bouncycastle.asn1.ASN1ObjectIdentifier algOid,
                                                      java.lang.String algorithmName)
        Set the algorithm mapping for a particular OID to the given algorithm name.
        Parameters:
        algOid - object identifier used to identify the public/private key
        algorithmName - algorithm name we want to map to in the provider.
        Returns:
        the current builder instance.
      • getKeyPair

        public java.security.KeyPair getKeyPair​(PEMKeyPair keyPair)
                                         throws PEMException
        Convert a PEMKeyPair into a KeyPair, returning the converted result.
        Parameters:
        keyPair - the PEMKeyPair to be converted.
        Returns:
        the result of the conversion
        Throws:
        PEMException - if an exception is thrown attempting to do the conversion.
      • getPublicKey

        public java.security.PublicKey getPublicKey​(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo publicKeyInfo)
                                             throws PEMException
        Throws:
        PEMException
      • getPrivateKey

        public java.security.PrivateKey getPrivateKey​(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privateKeyInfo)
                                               throws PEMException
        Throws:
        PEMException