src/java.base/share/classes/sun/security/rsa/RSAKeyPairGenerator.java
author valeriep
Wed, 07 Nov 2018 01:04:26 +0000
changeset 52430 4ee78b5583f9
parent 50204 3195a713e24d
permissions -rw-r--r--
8211049: Second parameter of "initialize" method is not used Summary: Use the specified random object instead of system default Reviewed-by: weijun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
50204
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
     2
 * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2596
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2596
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2596
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2596
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2596
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.security.rsa;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.math.BigInteger;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.security.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.security.spec.AlgorithmParameterSpec;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.security.spec.RSAKeyGenParameterSpec;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import sun.security.jca.JCAUtil;
47421
f9e03aef3a49 8181048: Refactor existing providers to refer to the same constants for default values for key length
valeriep
parents: 47216
diff changeset
    35
import static sun.security.util.SecurityProviderConstants.DEF_RSA_KEY_SIZE;
50204
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
    36
import static sun.security.util.SecurityProviderConstants.DEF_RSASSA_PSS_KEY_SIZE;
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
    37
import sun.security.x509.AlgorithmId;
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
    38
import static sun.security.rsa.RSAUtil.KeyType;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * RSA keypair generation. Standard algorithm, minimum key length 512 bit.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * We generate two random primes until we find two where phi is relative
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * prime to the public exponent. Default exponent is 65537. It has only bit 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * and bit 4 set, which makes it particularly efficient.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * @author  Andreas Sterbenz
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 */
50204
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
    49
public abstract class RSAKeyPairGenerator extends KeyPairGeneratorSpi {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    // public exponent to use
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    private BigInteger publicExponent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
2596
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
    54
    // size of the key to generate, >= RSAKeyFactory.MIN_MODLEN
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    private int keySize;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
50204
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
    57
    private final KeyType type;
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
    58
    private AlgorithmId rsaId;
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
    59
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    // PRNG to use
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    private SecureRandom random;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
50204
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
    63
    RSAKeyPairGenerator(KeyType type, int defKeySize) {
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
    64
        this.type = type;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        // initialize to default in case the app does not call initialize()
50204
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
    66
        initialize(defKeySize, null);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    // initialize the generator. See JCA doc
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    public void initialize(int keySize, SecureRandom random) {
2596
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
    71
        try {
50204
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
    72
            initialize(new RSAKeyGenParameterSpec(keySize,
52430
4ee78b5583f9 8211049: Second parameter of "initialize" method is not used
valeriep
parents: 50204
diff changeset
    73
                    RSAKeyGenParameterSpec.F4), random);
50204
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
    74
        } catch (InvalidAlgorithmParameterException iape) {
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
    75
            throw new InvalidParameterException(iape.getMessage());
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    // second initialize method. See JCA doc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    public void initialize(AlgorithmParameterSpec params, SecureRandom random)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
            throws InvalidAlgorithmParameterException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        if (params instanceof RSAKeyGenParameterSpec == false) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
            throw new InvalidAlgorithmParameterException
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                ("Params must be instance of RSAKeyGenParameterSpec");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        }
2596
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
    86
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        RSAKeyGenParameterSpec rsaSpec = (RSAKeyGenParameterSpec)params;
2596
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
    88
        int tmpKeySize = rsaSpec.getKeysize();
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
    89
        BigInteger tmpPublicExponent = rsaSpec.getPublicExponent();
50204
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
    90
        AlgorithmParameterSpec tmpParams = rsaSpec.getKeyParams();
2596
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
    91
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
    92
        if (tmpPublicExponent == null) {
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
    93
            tmpPublicExponent = RSAKeyGenParameterSpec.F4;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        } else {
2596
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
    95
            if (tmpPublicExponent.compareTo(RSAKeyGenParameterSpec.F0) < 0) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
                throw new InvalidAlgorithmParameterException
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
                        ("Public exponent must be 3 or larger");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
            }
2596
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
    99
            if (tmpPublicExponent.bitLength() > tmpKeySize) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
                throw new InvalidAlgorithmParameterException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
                        ("Public exponent must be smaller than key size");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        }
2596
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
   104
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
   105
        // do not allow unreasonably large key sizes, probably user error
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
   106
        try {
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
   107
            RSAKeyFactory.checkKeyLengths(tmpKeySize, tmpPublicExponent,
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
   108
                512, 64 * 1024);
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
   109
        } catch (InvalidKeyException e) {
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
   110
            throw new InvalidAlgorithmParameterException(
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
   111
                "Invalid key sizes", e);
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
   112
        }
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
   113
50204
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   114
        try {
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   115
            this.rsaId = RSAUtil.createAlgorithmId(type, tmpParams);
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   116
        } catch (ProviderException e) {
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   117
            throw new InvalidAlgorithmParameterException(
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   118
                "Invalid key parameters", e);
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   119
        }
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   120
2596
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
   121
        this.keySize = tmpKeySize;
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
   122
        this.publicExponent = tmpPublicExponent;
a1964c157e68 6497740: Limit the size of RSA public keys
wetmore
parents: 2
diff changeset
   123
        this.random = random;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    // generate the keypair. See JCA doc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    public KeyPair generateKeyPair() {
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 5506
diff changeset
   128
        // accommodate odd key sizes in case anybody wants to use them
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        int lp = (keySize + 1) >> 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        int lq = keySize - lp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        if (random == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
            random = JCAUtil.getSecureRandom();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        BigInteger e = publicExponent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        while (true) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
            // generate two random primes of size lp/lq
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
            BigInteger p = BigInteger.probablePrime(lp, random);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
            BigInteger q, n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
            do {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
                q = BigInteger.probablePrime(lq, random);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
                // convention is for p > q
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
                if (p.compareTo(q) < 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
                    BigInteger tmp = p;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
                    p = q;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
                    q = tmp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
                // modulus n = p * q
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
                n = p.multiply(q);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
                // even with correctly sized p and q, there is a chance that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
                // n will be one bit short. re-generate the smaller prime if so
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
            } while (n.bitLength() < keySize);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
            // phi = (p - 1) * (q - 1) must be relative prime to e
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
            // otherwise RSA just won't work ;-)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            BigInteger p1 = p.subtract(BigInteger.ONE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
            BigInteger q1 = q.subtract(BigInteger.ONE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
            BigInteger phi = p1.multiply(q1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
            // generate new p and q until they work. typically
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
            // the first try will succeed when using F4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
            if (e.gcd(phi).equals(BigInteger.ONE) == false) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
                continue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
            // private exponent d is the inverse of e mod phi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
            BigInteger d = e.modInverse(phi);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
            // 1st prime exponent pe = d mod (p - 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
            BigInteger pe = d.mod(p1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            // 2nd prime exponent qe = d mod (q - 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            BigInteger qe = d.mod(q1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            // crt coefficient coeff is the inverse of q mod p
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
            BigInteger coeff = q.modInverse(p);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            try {
50204
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   176
                PublicKey publicKey = new RSAPublicKeyImpl(rsaId, n, e);
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   177
                PrivateKey privateKey = new RSAPrivateCrtKeyImpl(
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   178
                    rsaId, n, e, d, p, q, pe, qe, coeff);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                return new KeyPair(publicKey, privateKey);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            } catch (InvalidKeyException exc) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                // invalid key exception only thrown for keys < 512 bit,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                // will not happen here
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
                throw new RuntimeException(exc);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
50204
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   188
    public static final class Legacy extends RSAKeyPairGenerator {
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   189
        public Legacy() {
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   190
            super(KeyType.RSA, DEF_RSA_KEY_SIZE);
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   191
        }
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   192
    }
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   193
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   194
    public static final class PSS extends RSAKeyPairGenerator {
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   195
        public PSS() {
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   196
            super(KeyType.PSS, DEF_RSASSA_PSS_KEY_SIZE);
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   197
        }
3195a713e24d 8146293: Add support for RSASSA-PSS Signature algorithm
valeriep
parents: 47421
diff changeset
   198
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
}