text: //
  //  Generated by the J2ObjC translator.  DO NOT EDIT!
  //  source: android/platform/libcore/ojluni/src/main/java/java/security/KeyFactory.java
  //
  
  #include "J2ObjC_header.h"
  
  #pragma push_macro("INCLUDE_ALL_JavaSecurityKeyFactory")
  #ifdef RESTRICT_JavaSecurityKeyFactory
  #define INCLUDE_ALL_JavaSecurityKeyFactory 0
  #else
  #define INCLUDE_ALL_JavaSecurityKeyFactory 1
  #endif
  #undef RESTRICT_JavaSecurityKeyFactory
  
  #pragma clang diagnostic push
  #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
  
  #if __has_feature(nullability)
  #pragma clang diagnostic push
  #pragma GCC diagnostic ignored "-Wnullability"
  #pragma GCC diagnostic ignored "-Wnullability-completeness"
  #endif
  
  #if !defined (JavaSecurityKeyFactory_) && (INCLUDE_ALL_JavaSecurityKeyFactory || defined(INCLUDE_JavaSecurityKeyFactory))
  #define JavaSecurityKeyFactory_
  
  @class IOSClass;
  @class JavaSecurityKeyFactorySpi;
  @class JavaSecurityProvider;
  @protocol JavaSecurityKey;
  @protocol JavaSecurityPrivateKey;
  @protocol JavaSecurityPublicKey;
  @protocol JavaSecuritySpecKeySpec;
  
  /*!
   @brief Key factories are used to convert <I>keys</I> (opaque
    cryptographic keys of type <code>Key</code>) into <I>key specifications</I>
    (transparent representations of the underlying key material), and vice
    versa.
   <P> Key factories are bi-directional. That is, they allow you to build an
    opaque key object from a given key specification (key material), or to
    retrieve the underlying key material of a key object in a suitable format. 
   <P> Multiple compatible key specifications may exist for the same key.
    For example, a DSA public key may be specified using 
   <code>DSAPublicKeySpec</code> or 
   <code>X509EncodedKeySpec</code>. A key factory can be used to translate
    between compatible key specifications. 
   <P> The following is an example of how to use a key factory in order to
    instantiate a DSA public key from its encoding.
    Assume Alice has received a digital signature from Bob.
    Bob also sent her his public key (in encoded format) to verify
    his signature. Alice then performs the following actions: 
   @code
  
    X509EncodedKeySpec bobPubKeySpec = new X509EncodedKeySpec(bobEncodedPubKey);
    KeyFactory keyFactory = KeyFactory.getInstance("DSA");
    PublicKey bobPubKey = keyFactory.generatePublic(bobPubKeySpec);
    Signature sig = Signature.getInstance("DSA");
    sig.initVerify(bobPubKey);
    sig.update(data);
    sig.verify(signature); 
    
  @endcode
    
   <p> Android provides the following <code>KeyFactory</code> algorithms: 
   <table>
      <thead>
        <tr>
          <th>Algorithm</th>
          <th>Supported API Levels</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>DH</td>
          <td>1+</td>
        </tr>
        <tr>
          <td>DSA</td>
          <td>1+</td>
        </tr>
        <tr>
          <td>EC</td>
          <td>11+</td>
        </tr>
        <tr>
          <td>RSA</td>
          <td>1+</td>
        </tr>
        <tr class="deprecated">
          <td>X.509</td>
          <td>1-8</td>
        </tr>
      </tbody>
    </table>
    These algorithms are described in the <a href="{@@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyFactory">
    KeyFactory section</a> of the
    Java Cryptography Architecture Standard Algorithm Name Documentation.
   @author Jan Luehe
   - seealso: Key
   - seealso: PublicKey
   - seealso: PrivateKey
   - seealso: java.security.spec.KeySpec
   - seealso: java.security.spec.DSAPublicKeySpec
   - seealso: java.security.spec.X509EncodedKeySpec
   @since 1.2
   */
  @interface JavaSecurityKeyFactory : NSObject
  
  #pragma mark Public
  
  /*!
   @brief Generates a private key object from the provided key specification
    (key material).
   @param keySpec the specification (key material) of the private key.
   @return the private key.
   @throw InvalidKeySpecExceptionif the given key specification
    is inappropriate for this key factory to produce a private key.
   */
  - (id<JavaSecurityPrivateKey>)generatePrivateWithJavaSecuritySpecKeySpec:(id<JavaSecuritySpecKeySpec>)keySpec;
  
  /*!
   @brief Generates a public key object from the provided key specification
    (key material).
   @param keySpec the specification (key material) of the public key.
   @return the public key.
   @throw InvalidKeySpecExceptionif the given key specification
    is inappropriate for this key factory to produce a public key.
   */
  - (id<JavaSecurityPublicKey>)generatePublicWithJavaSecuritySpecKeySpec:(id<JavaSecuritySpecKeySpec>)keySpec;
  
  /*!
   @brief Gets the name of the algorithm
    associated with this <code>KeyFactory</code>.
   @return the name of the algorithm associated with this 
   <code>KeyFactory</code>
   */
  - (NSString *)getAlgorithm;
  
  /*!
   @brief Returns a KeyFactory object that converts
    public/private keys of the specified algorithm.
   <p> This method traverses the list of registered security Providers,
    starting with the most preferred Provider.
    A new KeyFactory object encapsulating the
    KeyFactorySpi implementation from the first
    Provider that supports the specified algorithm is returned. 
   <p> Note that the list of registered providers may be retrieved via the 
   <code>Security.getProviders()</code> method.
   @param algorithm the name of the requested key algorithm.  See the KeyFactory section in the 
    <a href="{@@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyFactory">
     Java Cryptography Architecture Standard Algorithm Name Documentation
    </a>  for information about standard algorithm names.
   @return the new KeyFactory object.
   @throw NoSuchAlgorithmExceptionif no Provider supports a
             KeyFactorySpi implementation for the
             specified algorithm.
   - seealso: Provider
   */
  + (JavaSecurityKeyFactory *)getInstanceWithNSString:(NSString *)algorithm;
  
  /*!
   @brief Returns a KeyFactory object that converts
    public/private keys of the specified algorithm.
   <p> A new KeyFactory object encapsulating the
    KeyFactorySpi implementation from the specified Provider
    object is returned.  Note that the specified Provider object
    does not have to be registered in the provider list.
   @param algorithm the name of the requested key algorithm.  See the KeyFactory section in the 
    <a href="{@@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyFactory">
     Java Cryptography Architecture Standard Algorithm Name Documentation
    </a>  for information about standard algorithm names.
   @param provider the provider.
   @return the new KeyFactory object.
   @throw NoSuchAlgorithmExceptionif a KeyFactorySpi
             implementation for the specified algorithm is not available
             from the specified Provider object.
   @throw IllegalArgumentExceptionif the specified provider is null.
   - seealso: Provider
   @since 1.4
   */
  + (JavaSecurityKeyFactory *)getInstanceWithNSString:(NSString *)algorithm
                             withJavaSecurityProvider:(JavaSecurityProvider *)provider;
  
  /*!
   @brief Returns a KeyFactory object that converts
    public/private keys of the specified algorithm.
   <p> A new KeyFactory object encapsulating the
    KeyFactorySpi implementation from the specified provider
    is returned.  The specified provider must be registered
    in the security provider list. 
   <p> Note that the list of registered providers may be retrieved via the 
   <code>Security.getProviders()</code> method.
   @param algorithm the name of the requested key algorithm.  See the KeyFactory section in the 
    <a href="{@@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyFactory">
     Java Cryptography Architecture Standard Algorithm Name Documentation
    </a>  for information about standard algorithm names.
   @param provider the name of the provider.
   @return the new KeyFactory object.
   @throw NoSuchAlgorithmExceptionif a KeyFactorySpi
             implementation for the specified algorithm is not
             available from the specified provider.
   @throw NoSuchProviderExceptionif the specified provider is not
             registered in the security provider list.
   @throw IllegalArgumentExceptionif the provider name is null
             or empty.
   - seealso: Provider
   */
  + (JavaSecurityKeyFactory *)getInstanceWithNSString:(NSString *)algorithm
                                         withNSString:(NSString *)provider;
  
  /*!
   @brief Returns a specification (key material) of the given key object.
   <code>keySpec</code> identifies the specification class in which
    the key material should be returned. It could, for example, be 
   <code>DSAPublicKeySpec.class</code>, to indicate that the
    key material should be returned in an instance of the 
   <code>DSAPublicKeySpec</code> class.
   @param key the key.
   @param keySpec the specification class in which  the key material should be returned.
   @return the underlying key specification (key material) in an instance
    of the requested specification class.
   @throw InvalidKeySpecExceptionif the requested key specification is
    inappropriate for the given key, or the given key cannot be processed
    (e.g., the given key has an unrecognized algorithm or format).
   */
  - (id<JavaSecuritySpecKeySpec>)getKeySpecWithJavaSecurityKey:(id<JavaSecurityKey>)key
                                                  withIOSClass:(IOSClass *)keySpec;
  
  /*!
   @brief Returns the provider of this key factory object.
   @return the provider of this key factory object
   */
  - (JavaSecurityProvider *)getProvider;
  
  /*!
   @brief Translates a key object, whose provider may be unknown or potentially
    untrusted, into a corresponding key object of this key factory.
   @param key the key whose provider is unknown or untrusted.
   @return the translated key.
   @throw InvalidKeyExceptionif the given key cannot be processed
    by this key factory.
   */
  - (id<JavaSecurityKey>)translateKeyWithJavaSecurityKey:(id<JavaSecurityKey>)key;
  
  #pragma mark Protected
  
  /*!
   @brief Creates a KeyFactory object.
   @param keyFacSpi the delegate
   @param provider the provider
   @param algorithm the name of the algorithm  to associate with this 
   <code>KeyFactory</code>
   */
  - (instancetype __nonnull)initWithJavaSecurityKeyFactorySpi:(JavaSecurityKeyFactorySpi *)keyFacSpi
                                     withJavaSecurityProvider:(JavaSecurityProvider *)provider
                                                 withNSString:(NSString *)algorithm;
  
  // Disallowed inherited constructors, do not use.
  
  - (instancetype __nonnull)init NS_UNAVAILABLE;
  
  @end
  
  J2OBJC_STATIC_INIT(JavaSecurityKeyFactory)
  
  FOUNDATION_EXPORT void JavaSecurityKeyFactory_initWithJavaSecurityKeyFactorySpi_withJavaSecurityProvider_withNSString_(JavaSecurityKeyFactory *self, JavaSecurityKeyFactorySpi *keyFacSpi, JavaSecurityProvider *provider, NSString *algorithm);
  
  FOUNDATION_EXPORT JavaSecurityKeyFactory *new_JavaSecurityKeyFactory_initWithJavaSecurityKeyFactorySpi_withJavaSecurityProvider_withNSString_(JavaSecurityKeyFactorySpi *keyFacSpi, JavaSecurityProvider *provider, NSString *algorithm) NS_RETURNS_RETAINED;
  
  FOUNDATION_EXPORT JavaSecurityKeyFactory *create_JavaSecurityKeyFactory_initWithJavaSecurityKeyFactorySpi_withJavaSecurityProvider_withNSString_(JavaSecurityKeyFactorySpi *keyFacSpi, JavaSecurityProvider *provider, NSString *algorithm);
  
  FOUNDATION_EXPORT JavaSecurityKeyFactory *JavaSecurityKeyFactory_getInstanceWithNSString_(NSString *algorithm);
  
  FOUNDATION_EXPORT JavaSecurityKeyFactory *JavaSecurityKeyFactory_getInstanceWithNSString_withNSString_(NSString *algorithm, NSString *provider);
  
  FOUNDATION_EXPORT JavaSecurityKeyFactory *JavaSecurityKeyFactory_getInstanceWithNSString_withJavaSecurityProvider_(NSString *algorithm, JavaSecurityProvider *provider);
  
  J2OBJC_TYPE_LITERAL_HEADER(JavaSecurityKeyFactory)
  
  #endif
  
  
  #if __has_feature(nullability)
  #pragma clang diagnostic pop
  #endif
  
  #pragma clang diagnostic pop
  #pragma pop_macro("INCLUDE_ALL_JavaSecurityKeyFactory")
  