Class RSAKeyFactory


  • public class RSAKeyFactory
    extends java.security.KeyFactorySpi
    KeyFactory for RSA keys. Keys must be instances of PublicKey or PrivateKey and getAlgorithm() must return "RSA". For such keys, it supports conversion between the following: For public keys: . PublicKey with an X.509 encoding . RSAPublicKey . RSAPublicKeySpec . X509EncodedKeySpec For private keys: . RSAPrivateKey . RSAPrivateKeySpec . PKCS8EncodedKeySpec (of course, CRT variants only for CRT keys)
    • Constructor Summary

      Constructors 
      Constructor Description
      RSAKeyFactory()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.security.PrivateKey engineGeneratePrivate​(java.security.spec.KeySpec keySpec)  
      protected java.security.PublicKey engineGeneratePublic​(java.security.spec.KeySpec keySpec)  
      protected <T extends java.security.spec.KeySpec>
      T
      engineGetKeySpec​(java.security.Key key, java.lang.Class<T> keySpec)  
      protected java.security.Key engineTranslateKey​(java.security.Key key)  
      • Methods inherited from class java.lang.Object

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

      • RSAKeyFactory

        public RSAKeyFactory()
    • Method Detail

      • engineGeneratePublic

        protected java.security.PublicKey engineGeneratePublic​(java.security.spec.KeySpec keySpec)
                                                        throws java.security.spec.InvalidKeySpecException
        Specified by:
        engineGeneratePublic in class java.security.KeyFactorySpi
        Throws:
        java.security.spec.InvalidKeySpecException
      • engineGeneratePrivate

        protected java.security.PrivateKey engineGeneratePrivate​(java.security.spec.KeySpec keySpec)
                                                          throws java.security.spec.InvalidKeySpecException
        Specified by:
        engineGeneratePrivate in class java.security.KeyFactorySpi
        Throws:
        java.security.spec.InvalidKeySpecException
      • engineGetKeySpec

        protected <T extends java.security.spec.KeySpec> T engineGetKeySpec​(java.security.Key key,
                                                                            java.lang.Class<T> keySpec)
                                                                     throws java.security.spec.InvalidKeySpecException
        Specified by:
        engineGetKeySpec in class java.security.KeyFactorySpi
        Throws:
        java.security.spec.InvalidKeySpecException
      • engineTranslateKey

        protected java.security.Key engineTranslateKey​(java.security.Key key)
                                                throws java.security.InvalidKeyException
        Specified by:
        engineTranslateKey in class java.security.KeyFactorySpi
        Throws:
        java.security.InvalidKeyException