feat(jdk8): move files to new folder to avoid resources compiled.
This commit is contained in:
50
jdkSrc/jdk8/java/security/interfaces/DSAKey.java
Normal file
50
jdkSrc/jdk8/java/security/interfaces/DSAKey.java
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.security.interfaces;
|
||||
|
||||
/**
|
||||
* The interface to a DSA public or private key. DSA (Digital Signature
|
||||
* Algorithm) is defined in NIST's FIPS-186.
|
||||
*
|
||||
* @see DSAParams
|
||||
* @see java.security.Key
|
||||
* @see java.security.Signature
|
||||
*
|
||||
* @author Benjamin Renaud
|
||||
* @author Josh Bloch
|
||||
*/
|
||||
public interface DSAKey {
|
||||
|
||||
/**
|
||||
* Returns the DSA-specific key parameters. These parameters are
|
||||
* never secret.
|
||||
*
|
||||
* @return the DSA-specific key parameters.
|
||||
*
|
||||
* @see DSAParams
|
||||
*/
|
||||
public DSAParams getParams();
|
||||
}
|
||||
117
jdkSrc/jdk8/java/security/interfaces/DSAKeyPairGenerator.java
Normal file
117
jdkSrc/jdk8/java/security/interfaces/DSAKeyPairGenerator.java
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.security.interfaces;
|
||||
|
||||
import java.security.*;
|
||||
|
||||
/**
|
||||
* An interface to an object capable of generating DSA key pairs.
|
||||
*
|
||||
* <p>The {@code initialize} methods may each be called any number
|
||||
* of times. If no {@code initialize} method is called on a
|
||||
* DSAKeyPairGenerator, the default is to generate 1024-bit keys, using
|
||||
* precomputed p, q and g parameters and an instance of SecureRandom as
|
||||
* the random bit source.
|
||||
*
|
||||
* <p>Users wishing to indicate DSA-specific parameters, and to generate a key
|
||||
* pair suitable for use with the DSA algorithm typically
|
||||
*
|
||||
* <ol>
|
||||
*
|
||||
* <li>Get a key pair generator for the DSA algorithm by calling the
|
||||
* KeyPairGenerator {@code getInstance} method with "DSA"
|
||||
* as its argument.
|
||||
*
|
||||
* <li>Initialize the generator by casting the result to a DSAKeyPairGenerator
|
||||
* and calling one of the
|
||||
* {@code initialize} methods from this DSAKeyPairGenerator interface.
|
||||
*
|
||||
* <li>Generate a key pair by calling the {@code generateKeyPair}
|
||||
* method from the KeyPairGenerator class.
|
||||
*
|
||||
* </ol>
|
||||
*
|
||||
* <p>Note: it is not always necessary to do do algorithm-specific
|
||||
* initialization for a DSA key pair generator. That is, it is not always
|
||||
* necessary to call an {@code initialize} method in this interface.
|
||||
* Algorithm-independent initialization using the {@code initialize} method
|
||||
* in the KeyPairGenerator
|
||||
* interface is all that is needed when you accept defaults for algorithm-specific
|
||||
* parameters.
|
||||
*
|
||||
* <p>Note: Some earlier implementations of this interface may not support
|
||||
* larger sizes of DSA parameters such as 2048 and 3072-bit.
|
||||
*
|
||||
* @see java.security.KeyPairGenerator
|
||||
*/
|
||||
public interface DSAKeyPairGenerator {
|
||||
|
||||
/**
|
||||
* Initializes the key pair generator using the DSA family parameters
|
||||
* (p,q and g) and an optional SecureRandom bit source. If a
|
||||
* SecureRandom bit source is needed but not supplied, i.e. null, a
|
||||
* default SecureRandom instance will be used.
|
||||
*
|
||||
* @param params the parameters to use to generate the keys.
|
||||
*
|
||||
* @param random the random bit source to use to generate key bits;
|
||||
* can be null.
|
||||
*
|
||||
* @exception InvalidParameterException if the {@code params}
|
||||
* value is invalid, null, or unsupported.
|
||||
*/
|
||||
public void initialize(DSAParams params, SecureRandom random)
|
||||
throws InvalidParameterException;
|
||||
|
||||
/**
|
||||
* Initializes the key pair generator for a given modulus length
|
||||
* (instead of parameters), and an optional SecureRandom bit source.
|
||||
* If a SecureRandom bit source is needed but not supplied, i.e.
|
||||
* null, a default SecureRandom instance will be used.
|
||||
*
|
||||
* <p>If {@code genParams} is true, this method generates new
|
||||
* p, q and g parameters. If it is false, the method uses precomputed
|
||||
* parameters for the modulus length requested. If there are no
|
||||
* precomputed parameters for that modulus length, an exception will be
|
||||
* thrown. It is guaranteed that there will always be
|
||||
* default parameters for modulus lengths of 512 and 1024 bits.
|
||||
*
|
||||
* @param modlen the modulus length in bits. Valid values are any
|
||||
* multiple of 64 between 512 and 1024, inclusive, 2048, and 3072.
|
||||
*
|
||||
* @param random the random bit source to use to generate key bits;
|
||||
* can be null.
|
||||
*
|
||||
* @param genParams whether or not to generate new parameters for
|
||||
* the modulus length requested.
|
||||
*
|
||||
* @exception InvalidParameterException if {@code modlen} is
|
||||
* invalid, or unsupported, or if {@code genParams} is false and there
|
||||
* are no precomputed parameters for the requested modulus length.
|
||||
*/
|
||||
public void initialize(int modlen, boolean genParams, SecureRandom random)
|
||||
throws InvalidParameterException;
|
||||
}
|
||||
64
jdkSrc/jdk8/java/security/interfaces/DSAParams.java
Normal file
64
jdkSrc/jdk8/java/security/interfaces/DSAParams.java
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.security.interfaces;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
/**
|
||||
* Interface to a DSA-specific set of key parameters, which defines a
|
||||
* DSA <em>key family</em>. DSA (Digital Signature Algorithm) is defined
|
||||
* in NIST's FIPS-186.
|
||||
*
|
||||
* @see DSAKey
|
||||
* @see java.security.Key
|
||||
* @see java.security.Signature
|
||||
*
|
||||
* @author Benjamin Renaud
|
||||
* @author Josh Bloch
|
||||
*/
|
||||
public interface DSAParams {
|
||||
|
||||
/**
|
||||
* Returns the prime, {@code p}.
|
||||
*
|
||||
* @return the prime, {@code p}.
|
||||
*/
|
||||
public BigInteger getP();
|
||||
|
||||
/**
|
||||
* Returns the subprime, {@code q}.
|
||||
*
|
||||
* @return the subprime, {@code q}.
|
||||
*/
|
||||
public BigInteger getQ();
|
||||
|
||||
/**
|
||||
* Returns the base, {@code g}.
|
||||
*
|
||||
* @return the base, {@code g}.
|
||||
*/
|
||||
public BigInteger getG();
|
||||
}
|
||||
58
jdkSrc/jdk8/java/security/interfaces/DSAPrivateKey.java
Normal file
58
jdkSrc/jdk8/java/security/interfaces/DSAPrivateKey.java
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.security.interfaces;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
/**
|
||||
* The standard interface to a DSA private key. DSA (Digital Signature
|
||||
* Algorithm) is defined in NIST's FIPS-186.
|
||||
*
|
||||
* @see java.security.Key
|
||||
* @see java.security.Signature
|
||||
* @see DSAKey
|
||||
* @see DSAPublicKey
|
||||
*
|
||||
* @author Benjamin Renaud
|
||||
*/
|
||||
public interface DSAPrivateKey extends DSAKey, java.security.PrivateKey {
|
||||
|
||||
// Declare serialVersionUID to be compatible with JDK1.1
|
||||
|
||||
/**
|
||||
* The class fingerprint that is set to indicate
|
||||
* serialization compatibility with a previous
|
||||
* version of the class.
|
||||
*/
|
||||
static final long serialVersionUID = 7776497482533790279L;
|
||||
|
||||
/**
|
||||
* Returns the value of the private key, {@code x}.
|
||||
*
|
||||
* @return the value of the private key, {@code x}.
|
||||
*/
|
||||
public BigInteger getX();
|
||||
}
|
||||
58
jdkSrc/jdk8/java/security/interfaces/DSAPublicKey.java
Normal file
58
jdkSrc/jdk8/java/security/interfaces/DSAPublicKey.java
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.security.interfaces;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
/**
|
||||
* The interface to a DSA public key. DSA (Digital Signature Algorithm)
|
||||
* is defined in NIST's FIPS-186.
|
||||
*
|
||||
* @see java.security.Key
|
||||
* @see java.security.Signature
|
||||
* @see DSAKey
|
||||
* @see DSAPrivateKey
|
||||
*
|
||||
* @author Benjamin Renaud
|
||||
*/
|
||||
public interface DSAPublicKey extends DSAKey, java.security.PublicKey {
|
||||
|
||||
// Declare serialVersionUID to be compatible with JDK1.1
|
||||
|
||||
/**
|
||||
* The class fingerprint that is set to indicate
|
||||
* serialization compatibility with a previous
|
||||
* version of the class.
|
||||
*/
|
||||
static final long serialVersionUID = 1234526332779022332L;
|
||||
|
||||
/**
|
||||
* Returns the value of the public key, {@code y}.
|
||||
*
|
||||
* @return the value of the public key, {@code y}.
|
||||
*/
|
||||
public BigInteger getY();
|
||||
}
|
||||
45
jdkSrc/jdk8/java/security/interfaces/ECKey.java
Normal file
45
jdkSrc/jdk8/java/security/interfaces/ECKey.java
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package java.security.interfaces;
|
||||
|
||||
import java.security.spec.ECParameterSpec;
|
||||
|
||||
/**
|
||||
* The interface to an elliptic curve (EC) key.
|
||||
*
|
||||
* @author Valerie Peng
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public interface ECKey {
|
||||
/**
|
||||
* Returns the domain parameters associated
|
||||
* with this key. The domain parameters are
|
||||
* either explicitly specified or implicitly
|
||||
* created during key generation.
|
||||
* @return the associated domain parameters.
|
||||
*/
|
||||
ECParameterSpec getParams();
|
||||
}
|
||||
53
jdkSrc/jdk8/java/security/interfaces/ECPrivateKey.java
Normal file
53
jdkSrc/jdk8/java/security/interfaces/ECPrivateKey.java
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package java.security.interfaces;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.security.PrivateKey;
|
||||
|
||||
/**
|
||||
* The interface to an elliptic curve (EC) private key.
|
||||
*
|
||||
* @author Valerie Peng
|
||||
*
|
||||
*
|
||||
* @see PrivateKey
|
||||
* @see ECKey
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public interface ECPrivateKey extends PrivateKey, ECKey {
|
||||
/**
|
||||
* The class fingerprint that is set to indicate
|
||||
* serialization compatibility.
|
||||
*/
|
||||
static final long serialVersionUID = -7896394956925609184L;
|
||||
|
||||
/**
|
||||
* Returns the private value S.
|
||||
* @return the private value S.
|
||||
*/
|
||||
BigInteger getS();
|
||||
}
|
||||
55
jdkSrc/jdk8/java/security/interfaces/ECPublicKey.java
Normal file
55
jdkSrc/jdk8/java/security/interfaces/ECPublicKey.java
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package java.security.interfaces;
|
||||
|
||||
import java.security.PublicKey;
|
||||
import java.security.spec.ECPoint;
|
||||
|
||||
/**
|
||||
* The interface to an elliptic curve (EC) public key.
|
||||
*
|
||||
* @author Valerie Peng
|
||||
*
|
||||
*
|
||||
* @see PublicKey
|
||||
* @see ECKey
|
||||
* @see java.security.spec.ECPoint
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public interface ECPublicKey extends PublicKey, ECKey {
|
||||
|
||||
/**
|
||||
* The class fingerprint that is set to indicate
|
||||
* serialization compatibility.
|
||||
*/
|
||||
static final long serialVersionUID = -3314988629879632826L;
|
||||
|
||||
/**
|
||||
* Returns the public point W.
|
||||
* @return the public point W.
|
||||
*/
|
||||
ECPoint getW();
|
||||
}
|
||||
69
jdkSrc/jdk8/java/security/interfaces/RSAKey.java
Normal file
69
jdkSrc/jdk8/java/security/interfaces/RSAKey.java
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.security.interfaces;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
|
||||
/**
|
||||
* The interface to a public or private key in
|
||||
* <a href="https://tools.ietf.org/rfc/rfc8017.txt">PKCS#1 v2.2</a> standard,
|
||||
* such as those for RSA, or RSASSA-PSS algorithms.
|
||||
*
|
||||
* @author Jan Luehe
|
||||
*
|
||||
* @see RSAPublicKey
|
||||
* @see RSAPrivateKey
|
||||
*
|
||||
* @since 1.3
|
||||
*/
|
||||
|
||||
public interface RSAKey {
|
||||
|
||||
/**
|
||||
* Returns the modulus.
|
||||
*
|
||||
* @return the modulus
|
||||
*/
|
||||
public BigInteger getModulus();
|
||||
|
||||
/**
|
||||
* Returns the parameters associated with this key.
|
||||
* The parameters are optional and may be either
|
||||
* explicitly specified or implicitly created during
|
||||
* key pair generation.
|
||||
*
|
||||
* @apiNote This method is defined in Java SE 8 Maintenance Release 3.
|
||||
* @implSpec
|
||||
* The default implementation returns {@code null}.
|
||||
*
|
||||
* @return the associated parameters, may be null
|
||||
* @since 8
|
||||
*/
|
||||
default AlgorithmParameterSpec getParams() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.security.interfaces;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.security.spec.RSAOtherPrimeInfo;
|
||||
|
||||
/**
|
||||
* The interface to an RSA multi-prime private key, as defined in the
|
||||
* <a href="https://tools.ietf.org/rfc/rfc8017.txt">PKCS#1 v2.2</a> standard,
|
||||
* using the <i>Chinese Remainder Theorem</i> (CRT) information values.
|
||||
*
|
||||
* @author Valerie Peng
|
||||
*
|
||||
*
|
||||
* @see java.security.spec.RSAPrivateKeySpec
|
||||
* @see java.security.spec.RSAMultiPrimePrivateCrtKeySpec
|
||||
* @see RSAPrivateKey
|
||||
* @see RSAPrivateCrtKey
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
|
||||
public interface RSAMultiPrimePrivateCrtKey extends RSAPrivateKey {
|
||||
|
||||
/**
|
||||
* The type fingerprint that is set to indicate
|
||||
* serialization compatibility with a previous
|
||||
* version of the type.
|
||||
*/
|
||||
static final long serialVersionUID = 618058533534628008L;
|
||||
|
||||
/**
|
||||
* Returns the public exponent.
|
||||
*
|
||||
* @return the public exponent.
|
||||
*/
|
||||
public BigInteger getPublicExponent();
|
||||
|
||||
/**
|
||||
* Returns the primeP.
|
||||
*
|
||||
* @return the primeP.
|
||||
*/
|
||||
public BigInteger getPrimeP();
|
||||
|
||||
/**
|
||||
* Returns the primeQ.
|
||||
*
|
||||
* @return the primeQ.
|
||||
*/
|
||||
public BigInteger getPrimeQ();
|
||||
|
||||
/**
|
||||
* Returns the primeExponentP.
|
||||
*
|
||||
* @return the primeExponentP.
|
||||
*/
|
||||
public BigInteger getPrimeExponentP();
|
||||
|
||||
/**
|
||||
* Returns the primeExponentQ.
|
||||
*
|
||||
* @return the primeExponentQ.
|
||||
*/
|
||||
public BigInteger getPrimeExponentQ();
|
||||
|
||||
/**
|
||||
* Returns the crtCoefficient.
|
||||
*
|
||||
* @return the crtCoefficient.
|
||||
*/
|
||||
public BigInteger getCrtCoefficient();
|
||||
|
||||
/**
|
||||
* Returns the otherPrimeInfo or null if there are only
|
||||
* two prime factors (p and q).
|
||||
*
|
||||
* @return the otherPrimeInfo.
|
||||
*/
|
||||
public RSAOtherPrimeInfo[] getOtherPrimeInfo();
|
||||
}
|
||||
91
jdkSrc/jdk8/java/security/interfaces/RSAPrivateCrtKey.java
Normal file
91
jdkSrc/jdk8/java/security/interfaces/RSAPrivateCrtKey.java
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.security.interfaces;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
/**
|
||||
* The interface to an RSA private key, as defined in the
|
||||
* <a href="https://tools.ietf.org/rfc/rfc8017.txt">PKCS#1 v2.2</a> standard,
|
||||
* using the <i>Chinese Remainder Theorem</i> (CRT) information values.
|
||||
*
|
||||
* @author Jan Luehe
|
||||
*
|
||||
*
|
||||
* @see RSAPrivateKey
|
||||
*/
|
||||
|
||||
public interface RSAPrivateCrtKey extends RSAPrivateKey {
|
||||
|
||||
/**
|
||||
* The type fingerprint that is set to indicate
|
||||
* serialization compatibility with a previous
|
||||
* version of the type.
|
||||
*/
|
||||
static final long serialVersionUID = -5682214253527700368L;
|
||||
|
||||
/**
|
||||
* Returns the public exponent.
|
||||
*
|
||||
* @return the public exponent
|
||||
*/
|
||||
public BigInteger getPublicExponent();
|
||||
|
||||
/**
|
||||
* Returns the primeP.
|
||||
|
||||
* @return the primeP
|
||||
*/
|
||||
public BigInteger getPrimeP();
|
||||
|
||||
/**
|
||||
* Returns the primeQ.
|
||||
*
|
||||
* @return the primeQ
|
||||
*/
|
||||
public BigInteger getPrimeQ();
|
||||
|
||||
/**
|
||||
* Returns the primeExponentP.
|
||||
*
|
||||
* @return the primeExponentP
|
||||
*/
|
||||
public BigInteger getPrimeExponentP();
|
||||
|
||||
/**
|
||||
* Returns the primeExponentQ.
|
||||
*
|
||||
* @return the primeExponentQ
|
||||
*/
|
||||
public BigInteger getPrimeExponentQ();
|
||||
|
||||
/**
|
||||
* Returns the crtCoefficient.
|
||||
*
|
||||
* @return the crtCoefficient
|
||||
*/
|
||||
public BigInteger getCrtCoefficient();
|
||||
}
|
||||
55
jdkSrc/jdk8/java/security/interfaces/RSAPrivateKey.java
Normal file
55
jdkSrc/jdk8/java/security/interfaces/RSAPrivateKey.java
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.security.interfaces;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
/**
|
||||
* The interface to an RSA private key.
|
||||
*
|
||||
* @author Jan Luehe
|
||||
*
|
||||
*
|
||||
* @see RSAPrivateCrtKey
|
||||
*/
|
||||
|
||||
public interface RSAPrivateKey extends java.security.PrivateKey, RSAKey
|
||||
{
|
||||
|
||||
/**
|
||||
* The type fingerprint that is set to indicate
|
||||
* serialization compatibility with a previous
|
||||
* version of the type.
|
||||
*/
|
||||
static final long serialVersionUID = 5187144804936595022L;
|
||||
|
||||
/**
|
||||
* Returns the private exponent.
|
||||
*
|
||||
* @return the private exponent
|
||||
*/
|
||||
public BigInteger getPrivateExponent();
|
||||
}
|
||||
52
jdkSrc/jdk8/java/security/interfaces/RSAPublicKey.java
Normal file
52
jdkSrc/jdk8/java/security/interfaces/RSAPublicKey.java
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.security.interfaces;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
/**
|
||||
* The interface to an RSA public key.
|
||||
*
|
||||
* @author Jan Luehe
|
||||
*
|
||||
*/
|
||||
|
||||
public interface RSAPublicKey extends java.security.PublicKey, RSAKey
|
||||
{
|
||||
/**
|
||||
* The type fingerprint that is set to indicate
|
||||
* serialization compatibility with a previous
|
||||
* version of the type.
|
||||
*/
|
||||
static final long serialVersionUID = -8727434096241101194L;
|
||||
|
||||
/**
|
||||
* Returns the public exponent.
|
||||
*
|
||||
* @return the public exponent
|
||||
*/
|
||||
public BigInteger getPublicExponent();
|
||||
}
|
||||
74
jdkSrc/jdk8/java/security/interfaces/package-info.java
Normal file
74
jdkSrc/jdk8/java/security/interfaces/package-info.java
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides interfaces for generating RSA (Rivest, Shamir and
|
||||
* Adleman AsymmetricCipher algorithm)
|
||||
* keys as defined in the RSA Laboratory Technical Note
|
||||
* PKCS#1, and DSA (Digital Signature
|
||||
* Algorithm) keys as defined in NIST's FIPS-186.
|
||||
* <P>
|
||||
* Note that these interfaces are intended only for key
|
||||
* implementations whose key material is accessible and
|
||||
* available. These interfaces are not intended for key
|
||||
* implementations whose key material resides in
|
||||
* inaccessible, protected storage (such as in a
|
||||
* hardware device).
|
||||
* <P>
|
||||
* For more developer information on how to use these
|
||||
* interfaces, including information on how to design
|
||||
* {@code Key} classes for hardware devices, please refer
|
||||
* to these cryptographic provider developer guides:
|
||||
* <ul>
|
||||
* <li><a href=
|
||||
* "{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
|
||||
* <b>How to Implement a Provider for the
|
||||
* Java™ Cryptography Architecture
|
||||
* </b></a></li>
|
||||
* </ul>
|
||||
*
|
||||
* <h2>Package Specification</h2>
|
||||
*
|
||||
* <ul>
|
||||
* <li>PKCS #1: RSA Cryptography Specifications, Version 2.2 (RFC 8017)</li>
|
||||
* <li>Federal Information Processing Standards Publication (FIPS PUB) 186:
|
||||
* Digital Signature Standard (DSS) </li>
|
||||
* </ul>
|
||||
*
|
||||
* <h2>Related Documentation</h2>
|
||||
*
|
||||
* For further documentation, please see:
|
||||
* <ul>
|
||||
* <li>
|
||||
* <a href=
|
||||
* "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
|
||||
* <b>Java™
|
||||
* Cryptography Architecture API Specification and Reference
|
||||
* </b></a></li>
|
||||
* </ul>
|
||||
*
|
||||
* @since JDK1.1
|
||||
*/
|
||||
package java.security.interfaces;
|
||||
Reference in New Issue
Block a user