0N/A/*
2362N/A * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage java.security.spec;
0N/A
0N/Aimport java.math.BigInteger;
0N/A
0N/A/**
0N/A * This class specifies an RSA private key, as defined in the PKCS#1
0N/A * standard, using the Chinese Remainder Theorem (CRT) information values for
0N/A * efficiency.
0N/A *
0N/A * @author Jan Luehe
0N/A *
0N/A *
0N/A * @see java.security.Key
0N/A * @see java.security.KeyFactory
0N/A * @see KeySpec
0N/A * @see PKCS8EncodedKeySpec
0N/A * @see RSAPrivateKeySpec
0N/A * @see RSAPublicKeySpec
0N/A */
0N/A
0N/Apublic class RSAPrivateCrtKeySpec extends RSAPrivateKeySpec {
0N/A
0N/A private final BigInteger publicExponent;
0N/A private final BigInteger primeP;
0N/A private final BigInteger primeQ;
0N/A private final BigInteger primeExponentP;
0N/A private final BigInteger primeExponentQ;
0N/A private final BigInteger crtCoefficient;
0N/A
0N/A
0N/A
0N/A /**
0N/A * Creates a new <code>RSAPrivateCrtKeySpec</code>
0N/A * given the modulus, publicExponent, privateExponent,
0N/A * primeP, primeQ, primeExponentP, primeExponentQ, and
0N/A * crtCoefficient as defined in PKCS#1.
0N/A *
0N/A * @param modulus the modulus n
0N/A * @param publicExponent the public exponent e
0N/A * @param privateExponent the private exponent d
0N/A * @param primeP the prime factor p of n
0N/A * @param primeQ the prime factor q of n
0N/A * @param primeExponentP this is d mod (p-1)
0N/A * @param primeExponentQ this is d mod (q-1)
0N/A * @param crtCoefficient the Chinese Remainder Theorem
0N/A * coefficient q-1 mod p
0N/A */
0N/A public RSAPrivateCrtKeySpec(BigInteger modulus,
0N/A BigInteger publicExponent,
0N/A BigInteger privateExponent,
0N/A BigInteger primeP,
0N/A BigInteger primeQ,
0N/A BigInteger primeExponentP,
0N/A BigInteger primeExponentQ,
0N/A BigInteger crtCoefficient) {
0N/A super(modulus, privateExponent);
0N/A this.publicExponent = publicExponent;
0N/A this.primeP = primeP;
0N/A this.primeQ = primeQ;
0N/A this.primeExponentP = primeExponentP;
0N/A this.primeExponentQ = primeExponentQ;
0N/A this.crtCoefficient = crtCoefficient;
0N/A }
0N/A
0N/A /**
0N/A * Returns the public exponent.
0N/A *
0N/A * @return the public exponent
0N/A */
0N/A public BigInteger getPublicExponent() {
0N/A return this.publicExponent;
0N/A }
0N/A
0N/A /**
0N/A * Returns the primeP.
0N/A
0N/A * @return the primeP
0N/A */
0N/A public BigInteger getPrimeP() {
0N/A return this.primeP;
0N/A }
0N/A
0N/A /**
0N/A * Returns the primeQ.
0N/A *
0N/A * @return the primeQ
0N/A */
0N/A public BigInteger getPrimeQ() {
0N/A return this.primeQ;
0N/A }
0N/A
0N/A /**
0N/A * Returns the primeExponentP.
0N/A *
0N/A * @return the primeExponentP
0N/A */
0N/A public BigInteger getPrimeExponentP() {
0N/A return this.primeExponentP;
0N/A }
0N/A
0N/A /**
0N/A * Returns the primeExponentQ.
0N/A *
0N/A * @return the primeExponentQ
0N/A */
0N/A public BigInteger getPrimeExponentQ() {
0N/A return this.primeExponentQ;
0N/A }
0N/A
0N/A /**
0N/A * Returns the crtCoefficient.
0N/A *
0N/A * @return the crtCoefficient
0N/A */
0N/A public BigInteger getCrtCoefficient() {
0N/A return this.crtCoefficient;
0N/A }
0N/A}