src/java.base/share/classes/java/security/KeyFactorySpi.java
changeset 58242 94bb65cb37d3
parent 47216 71c04702a3d5
equal deleted inserted replaced
58241:33de7752835c 58242:94bb65cb37d3
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    75      *
    75      *
    76      * @param keySpec the specification (key material) of the public key.
    76      * @param keySpec the specification (key material) of the public key.
    77      *
    77      *
    78      * @return the public key.
    78      * @return the public key.
    79      *
    79      *
    80      * @exception InvalidKeySpecException if the given key specification
    80      * @throws    InvalidKeySpecException if the given key specification
    81      * is inappropriate for this key factory to produce a public key.
    81      * is inappropriate for this key factory to produce a public key.
    82      */
    82      */
    83     protected abstract PublicKey engineGeneratePublic(KeySpec keySpec)
    83     protected abstract PublicKey engineGeneratePublic(KeySpec keySpec)
    84         throws InvalidKeySpecException;
    84         throws InvalidKeySpecException;
    85 
    85 
    89      *
    89      *
    90      * @param keySpec the specification (key material) of the private key.
    90      * @param keySpec the specification (key material) of the private key.
    91      *
    91      *
    92      * @return the private key.
    92      * @return the private key.
    93      *
    93      *
    94      * @exception InvalidKeySpecException if the given key specification
    94      * @throws    InvalidKeySpecException if the given key specification
    95      * is inappropriate for this key factory to produce a private key.
    95      * is inappropriate for this key factory to produce a private key.
    96      */
    96      */
    97     protected abstract PrivateKey engineGeneratePrivate(KeySpec keySpec)
    97     protected abstract PrivateKey engineGeneratePrivate(KeySpec keySpec)
    98         throws InvalidKeySpecException;
    98         throws InvalidKeySpecException;
    99 
    99 
   114      * the key material should be returned.
   114      * the key material should be returned.
   115      *
   115      *
   116      * @return the underlying key specification (key material) in an instance
   116      * @return the underlying key specification (key material) in an instance
   117      * of the requested specification class.
   117      * of the requested specification class.
   118 
   118 
   119      * @exception InvalidKeySpecException if the requested key specification is
   119      * @throws    InvalidKeySpecException if the requested key specification is
   120      * inappropriate for the given key, or the given key cannot be dealt with
   120      * inappropriate for the given key, or the given key cannot be dealt with
   121      * (e.g., the given key has an unrecognized format).
   121      * (e.g., the given key has an unrecognized format).
   122      */
   122      */
   123     protected abstract <T extends KeySpec>
   123     protected abstract <T extends KeySpec>
   124         T engineGetKeySpec(Key key, Class<T> keySpec)
   124         T engineGetKeySpec(Key key, Class<T> keySpec)
   131      *
   131      *
   132      * @param key the key whose provider is unknown or untrusted.
   132      * @param key the key whose provider is unknown or untrusted.
   133      *
   133      *
   134      * @return the translated key.
   134      * @return the translated key.
   135      *
   135      *
   136      * @exception InvalidKeyException if the given key cannot be processed
   136      * @throws    InvalidKeyException if the given key cannot be processed
   137      * by this key factory.
   137      * by this key factory.
   138      */
   138      */
   139     protected abstract Key engineTranslateKey(Key key)
   139     protected abstract Key engineTranslateKey(Key key)
   140         throws InvalidKeyException;
   140         throws InvalidKeyException;
   141 
   141