Showing the changes to java/pkg/java/security/interfaces (28 of 18352 files). Show all
Unified · Split
Binary file not shown.
| @@ -0,0 +1,50 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved. | |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| 4 | + * | |
| 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 | |
| 7 | + * published by the Free Software Foundation. Oracle designates this | |
| 8 | + * particular file as subject to the "Classpath" exception as provided | |
| 9 | + * by Oracle in the LICENSE file that accompanied this code. | |
| 10 | + * | |
| 11 | + * This code is distributed in the hope that it will be useful, but WITHOUT | |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 | + * version 2 for more details (a copy is included in the LICENSE file that | |
| 15 | + * accompanied this code). | |
| 16 | + * | |
| 17 | + * You should have received a copy of the GNU General Public License version | |
| 18 | + * 2 along with this work; if not, write to the Free Software Foundation, | |
| 19 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 20 | + * | |
| 21 | + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| 22 | + * or visit www.oracle.com if you need additional information or have any | |
| 23 | + * questions. | |
| 24 | + */ | |
| 25 | + | |
| 26 | +package java.security.interfaces; | |
| 27 | + | |
| 28 | +/** | |
| 29 | + * The interface to a DSA public or private key. DSA (Digital Signature | |
| 30 | + * Algorithm) is defined in NIST's FIPS-186. | |
| 31 | + * | |
| 32 | + * @see DSAParams | |
| 33 | + * @see java.security.Key | |
| 34 | + * @see java.security.Signature | |
| 35 | + * | |
| 36 | + * @author Benjamin Renaud | |
| 37 | + * @author Josh Bloch | |
| 38 | + */ | |
| 39 | +public interface DSAKey { | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * Returns the DSA-specific key parameters. These parameters are | |
| 43 | + * never secret. | |
| 44 | + * | |
| 45 | + * @return the DSA-specific key parameters. | |
| 46 | + * | |
| 47 | + * @see DSAParams | |
| 48 | + */ | |
| 49 | + public DSAParams getParams(); | |
| 50 | +} | |
Binary file not shown.
| @@ -0,0 +1,115 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. | |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| 4 | + * | |
| 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 | |
| 7 | + * published by the Free Software Foundation. Oracle designates this | |
| 8 | + * particular file as subject to the "Classpath" exception as provided | |
| 9 | + * by Oracle in the LICENSE file that accompanied this code. | |
| 10 | + * | |
| 11 | + * This code is distributed in the hope that it will be useful, but WITHOUT | |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 | + * version 2 for more details (a copy is included in the LICENSE file that | |
| 15 | + * accompanied this code). | |
| 16 | + * | |
| 17 | + * You should have received a copy of the GNU General Public License version | |
| 18 | + * 2 along with this work; if not, write to the Free Software Foundation, | |
| 19 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 20 | + * | |
| 21 | + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| 22 | + * or visit www.oracle.com if you need additional information or have any | |
| 23 | + * questions. | |
| 24 | + */ | |
| 25 | + | |
| 26 | +package java.security.interfaces; | |
| 27 | + | |
| 28 | +import java.security.*; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * An interface to an object capable of generating DSA key pairs. | |
| 32 | + * | |
| 33 | + * <p>The <code>initialize</code> methods may each be called any number | |
| 34 | + * of times. If no <code>initialize</code> method is called on a | |
| 35 | + * DSAKeyPairGenerator, the default is to generate 1024-bit keys, using | |
| 36 | + * precomputed p, q and g parameters and an instance of SecureRandom as | |
| 37 | + * the random bit source. | |
| 38 | + * | |
| 39 | + * <p>Users wishing to indicate DSA-specific parameters, and to generate a key | |
| 40 | + * pair suitable for use with the DSA algorithm typically | |
| 41 | + * | |
| 42 | + * <ol> | |
| 43 | + * | |
| 44 | + * <li>Get a key pair generator for the DSA algorithm by calling the | |
| 45 | + * KeyPairGenerator <code>getInstance</code> method with "DSA" | |
| 46 | + * as its argument.<p> | |
| 47 | + * | |
| 48 | + * <li>Initialize the generator by casting the result to a DSAKeyPairGenerator | |
| 49 | + * and calling one of the | |
| 50 | + * <code>initialize</code> methods from this DSAKeyPairGenerator interface.<p> | |
| 51 | + * | |
| 52 | + * <li>Generate a key pair by calling the <code>generateKeyPair</code> | |
| 53 | + * method from the KeyPairGenerator class. | |
| 54 | + * | |
| 55 | + * </ol> | |
| 56 | + * | |
| 57 | + * <p>Note: it is not always necessary to do do algorithm-specific | |
| 58 | + * initialization for a DSA key pair generator. That is, it is not always | |
| 59 | + * necessary to call an <code>initialize</code> method in this interface. | |
| 60 | + * Algorithm-independent initialization using the <code>initialize</code> method | |
| 61 | + * in the KeyPairGenerator | |
| 62 | + * interface is all that is needed when you accept defaults for algorithm-specific | |
| 63 | + * parameters. | |
| 64 | + * | |
| 65 | + * @see java.security.KeyPairGenerator | |
| 66 | + */ | |
| 67 | +public interface DSAKeyPairGenerator { | |
| 68 | + | |
| 69 | + /** | |
| 70 | + * Initializes the key pair generator using the DSA family parameters | |
| 71 | + * (p,q and g) and an optional SecureRandom bit source. If a | |
| 72 | + * SecureRandom bit source is needed but not supplied, i.e. null, a | |
| 73 | + * default SecureRandom instance will be used. | |
| 74 | + * | |
| 75 | + * @param params the parameters to use to generate the keys. | |
| 76 | + * | |
| 77 | + * @param random the random bit source to use to generate key bits; | |
| 78 | + * can be null. | |
| 79 | + * | |
| 80 | + * @exception InvalidParameterException if the <code>params</code> | |
| 81 | + * value is invalid or null. | |
| 82 | + */ | |
| 83 | + public void initialize(DSAParams params, SecureRandom random) | |
| 84 | + throws InvalidParameterException; | |
| 85 | + | |
| 86 | + /** | |
| 87 | + * Initializes the key pair generator for a given modulus length | |
| 88 | + * (instead of parameters), and an optional SecureRandom bit source. | |
| 89 | + * If a SecureRandom bit source is needed but not supplied, i.e. | |
| 90 | + * null, a default SecureRandom instance will be used. | |
| 91 | + * | |
| 92 | + * <p>If <code>genParams</code> is true, this method generates new | |
| 93 | + * p, q and g parameters. If it is false, the method uses precomputed | |
| 94 | + * parameters for the modulus length requested. If there are no | |
| 95 | + * precomputed parameters for that modulus length, an exception will be | |
| 96 | + * thrown. It is guaranteed that there will always be | |
| 97 | + * default parameters for modulus lengths of 512 and 1024 bits. | |
| 98 | + * | |
| 99 | + * @param modlen the modulus length in bits. Valid values are any | |
| 100 | + * multiple of 8 between 512 and 1024, inclusive. | |
| 101 | + * | |
| 102 | + * @param random the random bit source to use to generate key bits; | |
| 103 | + * can be null. | |
| 104 | + * | |
| 105 | + * @param genParams whether or not to generate new parameters for | |
| 106 | + * the modulus length requested. | |
| 107 | + * | |
| 108 | + * @exception InvalidParameterException if <code>modlen</code> is not | |
| 109 | + * between 512 and 1024, or if <code>genParams</code> is false and | |
| 110 | + * there are no precomputed parameters for the requested modulus | |
| 111 | + * length. | |
| 112 | + */ | |
| 113 | + public void initialize(int modlen, boolean genParams, SecureRandom random) | |
| 114 | + throws InvalidParameterException; | |
| 115 | +} | |
Binary file not shown.
| @@ -0,0 +1,64 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved. | |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| 4 | + * | |
| 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 | |
| 7 | + * published by the Free Software Foundation. Oracle designates this | |
| 8 | + * particular file as subject to the "Classpath" exception as provided | |
| 9 | + * by Oracle in the LICENSE file that accompanied this code. | |
| 10 | + * | |
| 11 | + * This code is distributed in the hope that it will be useful, but WITHOUT | |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 | + * version 2 for more details (a copy is included in the LICENSE file that | |
| 15 | + * accompanied this code). | |
| 16 | + * | |
| 17 | + * You should have received a copy of the GNU General Public License version | |
| 18 | + * 2 along with this work; if not, write to the Free Software Foundation, | |
| 19 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 20 | + * | |
| 21 | + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| 22 | + * or visit www.oracle.com if you need additional information or have any | |
| 23 | + * questions. | |
| 24 | + */ | |
| 25 | + | |
| 26 | +package java.security.interfaces; | |
| 27 | + | |
| 28 | +import java.math.BigInteger; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * Interface to a DSA-specific set of key parameters, which defines a | |
| 32 | + * DSA <em>key family</em>. DSA (Digital Signature Algorithm) is defined | |
| 33 | + * in NIST's FIPS-186. | |
| 34 | + * | |
| 35 | + * @see DSAKey | |
| 36 | + * @see java.security.Key | |
| 37 | + * @see java.security.Signature | |
| 38 | + * | |
| 39 | + * @author Benjamin Renaud | |
| 40 | + * @author Josh Bloch | |
| 41 | + */ | |
| 42 | +public interface DSAParams { | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * Returns the prime, <code>p</code>. | |
| 46 | + * | |
| 47 | + * @return the prime, <code>p</code>. | |
| 48 | + */ | |
| 49 | + public BigInteger getP(); | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * Returns the subprime, <code>q</code>. | |
| 53 | + * | |
| 54 | + * @return the subprime, <code>q</code>. | |
| 55 | + */ | |
| 56 | + public BigInteger getQ(); | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * Returns the base, <code>g</code>. | |
| 60 | + * | |
| 61 | + * @return the base, <code>g</code>. | |
| 62 | + */ | |
| 63 | + public BigInteger getG(); | |
| 64 | +} | |
Binary file not shown.
| @@ -0,0 +1,58 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. | |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| 4 | + * | |
| 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 | |
| 7 | + * published by the Free Software Foundation. Oracle designates this | |
| 8 | + * particular file as subject to the "Classpath" exception as provided | |
| 9 | + * by Oracle in the LICENSE file that accompanied this code. | |
| 10 | + * | |
| 11 | + * This code is distributed in the hope that it will be useful, but WITHOUT | |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 | + * version 2 for more details (a copy is included in the LICENSE file that | |
| 15 | + * accompanied this code). | |
| 16 | + * | |
| 17 | + * You should have received a copy of the GNU General Public License version | |
| 18 | + * 2 along with this work; if not, write to the Free Software Foundation, | |
| 19 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 20 | + * | |
| 21 | + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| 22 | + * or visit www.oracle.com if you need additional information or have any | |
| 23 | + * questions. | |
| 24 | + */ | |
| 25 | + | |
| 26 | +package java.security.interfaces; | |
| 27 | + | |
| 28 | +import java.math.BigInteger; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * The standard interface to a DSA private key. DSA (Digital Signature | |
| 32 | + * Algorithm) is defined in NIST's FIPS-186. | |
| 33 | + * | |
| 34 | + * @see java.security.Key | |
| 35 | + * @see java.security.Signature | |
| 36 | + * @see DSAKey | |
| 37 | + * @see DSAPublicKey | |
| 38 | + * | |
| 39 | + * @author Benjamin Renaud | |
| 40 | + */ | |
| 41 | +public interface DSAPrivateKey extends DSAKey, java.security.PrivateKey { | |
| 42 | + | |
| 43 | + // Declare serialVersionUID to be compatible with JDK1.1 | |
| 44 | + | |
| 45 | + /** | |
| 46 | + * The class fingerprint that is set to indicate | |
| 47 | + * serialization compatibility with a previous | |
| 48 | + * version of the class. | |
| 49 | + */ | |
| 50 | + static final long serialVersionUID = 7776497482533790279L; | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * Returns the value of the private key, <code>x</code>. | |
| 54 | + * | |
| 55 | + * @return the value of the private key, <code>x</code>. | |
| 56 | + */ | |
| 57 | + public BigInteger getX(); | |
| 58 | +} | |
Binary file not shown.
| @@ -0,0 +1,58 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved. | |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| 4 | + * | |
| 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 | |
| 7 | + * published by the Free Software Foundation. Oracle designates this | |
| 8 | + * particular file as subject to the "Classpath" exception as provided | |
| 9 | + * by Oracle in the LICENSE file that accompanied this code. | |
| 10 | + * | |
| 11 | + * This code is distributed in the hope that it will be useful, but WITHOUT | |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 | + * version 2 for more details (a copy is included in the LICENSE file that | |
| 15 | + * accompanied this code). | |
| 16 | + * | |
| 17 | + * You should have received a copy of the GNU General Public License version | |
| 18 | + * 2 along with this work; if not, write to the Free Software Foundation, | |
| 19 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 20 | + * | |
| 21 | + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| 22 | + * or visit www.oracle.com if you need additional information or have any | |
| 23 | + * questions. | |
| 24 | + */ | |
| 25 | + | |
| 26 | +package java.security.interfaces; | |
| 27 | + | |
| 28 | +import java.math.BigInteger; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * The interface to a DSA public key. DSA (Digital Signature Algorithm) | |
| 32 | + * is defined in NIST's FIPS-186. | |
| 33 | + * | |
| 34 | + * @see java.security.Key | |
| 35 | + * @see java.security.Signature | |
| 36 | + * @see DSAKey | |
| 37 | + * @see DSAPrivateKey | |
| 38 | + * | |
| 39 | + * @author Benjamin Renaud | |
| 40 | + */ | |
| 41 | +public interface DSAPublicKey extends DSAKey, java.security.PublicKey { | |
| 42 | + | |
| 43 | + // Declare serialVersionUID to be compatible with JDK1.1 | |
| 44 | + | |
| 45 | + /** | |
| 46 | + * The class fingerprint that is set to indicate | |
| 47 | + * serialization compatibility with a previous | |
| 48 | + * version of the class. | |
| 49 | + */ | |
| 50 | + static final long serialVersionUID = 1234526332779022332L; | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * Returns the value of the public key, <code>y</code>. | |
| 54 | + * | |
| 55 | + * @return the value of the public key, <code>y</code>. | |
| 56 | + */ | |
| 57 | + public BigInteger getY(); | |
| 58 | +} | |
Binary file not shown.
| @@ -0,0 +1,45 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. | |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| 4 | + * | |
| 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 | |
| 7 | + * published by the Free Software Foundation. Oracle designates this | |
| 8 | + * particular file as subject to the "Classpath" exception as provided | |
| 9 | + * by Oracle in the LICENSE file that accompanied this code. | |
| 10 | + * | |
| 11 | + * This code is distributed in the hope that it will be useful, but WITHOUT | |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 | + * version 2 for more details (a copy is included in the LICENSE file that | |
| 15 | + * accompanied this code). | |
| 16 | + * | |
| 17 | + * You should have received a copy of the GNU General Public License version | |
| 18 | + * 2 along with this work; if not, write to the Free Software Foundation, | |
| 19 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 20 | + * | |
| 21 | + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| 22 | + * or visit www.oracle.com if you need additional information or have any | |
| 23 | + * questions. | |
| 24 | + */ | |
| 25 | +package java.security.interfaces; | |
| 26 | + | |
| 27 | +import java.security.spec.ECParameterSpec; | |
| 28 | + | |
| 29 | +/** | |
| 30 | + * The interface to an elliptic curve (EC) key. | |
| 31 | + * | |
| 32 | + * @author Valerie Peng | |
| 33 | + * | |
| 34 | + * @since 1.5 | |
| 35 | + */ | |
| 36 | +public interface ECKey { | |
| 37 | + /** | |
| 38 | + * Returns the domain parameters associated | |
| 39 | + * with this key. The domain parameters are | |
| 40 | + * either explicitly specified or implicitly | |
| 41 | + * created during key generation. | |
| 42 | + * @return the associated domain parameters. | |
| 43 | + */ | |
| 44 | + ECParameterSpec getParams(); | |
| 45 | +} | |
Binary file not shown.
| @@ -0,0 +1,53 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. | |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| 4 | + * | |
| 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 | |
| 7 | + * published by the Free Software Foundation. Oracle designates this | |
| 8 | + * particular file as subject to the "Classpath" exception as provided | |
| 9 | + * by Oracle in the LICENSE file that accompanied this code. | |
| 10 | + * | |
| 11 | + * This code is distributed in the hope that it will be useful, but WITHOUT | |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 | + * version 2 for more details (a copy is included in the LICENSE file that | |
| 15 | + * accompanied this code). | |
| 16 | + * | |
| 17 | + * You should have received a copy of the GNU General Public License version | |
| 18 | + * 2 along with this work; if not, write to the Free Software Foundation, | |
| 19 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 20 | + * | |
| 21 | + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| 22 | + * or visit www.oracle.com if you need additional information or have any | |
| 23 | + * questions. | |
| 24 | + */ | |
| 25 | +package java.security.interfaces; | |
| 26 | + | |
| 27 | +import java.math.BigInteger; | |
| 28 | +import java.security.PrivateKey; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * The interface to an elliptic curve (EC) private key. | |
| 32 | + * | |
| 33 | + * @author Valerie Peng | |
| 34 | + * | |
| 35 | + * | |
| 36 | + * @see PrivateKey | |
| 37 | + * @see ECKey | |
| 38 | + * | |
| 39 | + * @since 1.5 | |
| 40 | + */ | |
| 41 | +public interface ECPrivateKey extends PrivateKey, ECKey { | |
| 42 | + /** | |
| 43 | + * The class fingerprint that is set to indicate | |
| 44 | + * serialization compatibility. | |
| 45 | + */ | |
| 46 | + static final long serialVersionUID = -7896394956925609184L; | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * Returns the private value S. | |
| 50 | + * @return the private value S. | |
| 51 | + */ | |
| 52 | + BigInteger getS(); | |
| 53 | +} | |
Binary file not shown.
| @@ -0,0 +1,55 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. | |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| 4 | + * | |
| 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 | |
| 7 | + * published by the Free Software Foundation. Oracle designates this | |
| 8 | + * particular file as subject to the "Classpath" exception as provided | |
| 9 | + * by Oracle in the LICENSE file that accompanied this code. | |
| 10 | + * | |
| 11 | + * This code is distributed in the hope that it will be useful, but WITHOUT | |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 | + * version 2 for more details (a copy is included in the LICENSE file that | |
| 15 | + * accompanied this code). | |
| 16 | + * | |
| 17 | + * You should have received a copy of the GNU General Public License version | |
| 18 | + * 2 along with this work; if not, write to the Free Software Foundation, | |
| 19 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 20 | + * | |
| 21 | + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| 22 | + * or visit www.oracle.com if you need additional information or have any | |
| 23 | + * questions. | |
| 24 | + */ | |
| 25 | +package java.security.interfaces; | |
| 26 | + | |
| 27 | +import java.security.PublicKey; | |
| 28 | +import java.security.spec.ECPoint; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * The interface to an elliptic curve (EC) public key. | |
| 32 | + * | |
| 33 | + * @author Valerie Peng | |
| 34 | + * | |
| 35 | + * | |
| 36 | + * @see PublicKey | |
| 37 | + * @see ECKey | |
| 38 | + * @see java.security.spec.ECPoint | |
| 39 | + * | |
| 40 | + * @since 1.5 | |
| 41 | + */ | |
| 42 | +public interface ECPublicKey extends PublicKey, ECKey { | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * The class fingerprint that is set to indicate | |
| 46 | + * serialization compatibility. | |
| 47 | + */ | |
| 48 | + static final long serialVersionUID = -3314988629879632826L; | |
| 49 | + | |
| 50 | + /** | |
| 51 | + * Returns the public point W. | |
| 52 | + * @return the public point W. | |
| 53 | + */ | |
| 54 | + ECPoint getW(); | |
| 55 | +} | |
Binary file not shown.
| @@ -0,0 +1,49 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. | |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| 4 | + * | |
| 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 | |
| 7 | + * published by the Free Software Foundation. Oracle designates this | |
| 8 | + * particular file as subject to the "Classpath" exception as provided | |
| 9 | + * by Oracle in the LICENSE file that accompanied this code. | |
| 10 | + * | |
| 11 | + * This code is distributed in the hope that it will be useful, but WITHOUT | |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 | + * version 2 for more details (a copy is included in the LICENSE file that | |
| 15 | + * accompanied this code). | |
| 16 | + * | |
| 17 | + * You should have received a copy of the GNU General Public License version | |
| 18 | + * 2 along with this work; if not, write to the Free Software Foundation, | |
| 19 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 20 | + * | |
| 21 | + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| 22 | + * or visit www.oracle.com if you need additional information or have any | |
| 23 | + * questions. | |
| 24 | + */ | |
| 25 | + | |
| 26 | +package java.security.interfaces; | |
| 27 | + | |
| 28 | +import java.math.BigInteger; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * The interface to an RSA public or private key. | |
| 32 | + * | |
| 33 | + * @author Jan Luehe | |
| 34 | + * | |
| 35 | + * @see RSAPublicKey | |
| 36 | + * @see RSAPrivateKey | |
| 37 | + * | |
| 38 | + * @since 1.3 | |
| 39 | + */ | |
| 40 | + | |
| 41 | +public interface RSAKey { | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * Returns the modulus. | |
| 45 | + * | |
| 46 | + * @return the modulus | |
| 47 | + */ | |
| 48 | + public BigInteger getModulus(); | |
| 49 | +} | |
Binary file not shown.
| @@ -0,0 +1,100 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. | |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| 4 | + * | |
| 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 | |
| 7 | + * published by the Free Software Foundation. Oracle designates this | |
| 8 | + * particular file as subject to the "Classpath" exception as provided | |
| 9 | + * by Oracle in the LICENSE file that accompanied this code. | |
| 10 | + * | |
| 11 | + * This code is distributed in the hope that it will be useful, but WITHOUT | |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 | + * version 2 for more details (a copy is included in the LICENSE file that | |
| 15 | + * accompanied this code). | |
| 16 | + * | |
| 17 | + * You should have received a copy of the GNU General Public License version | |
| 18 | + * 2 along with this work; if not, write to the Free Software Foundation, | |
| 19 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 20 | + * | |
| 21 | + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| 22 | + * or visit www.oracle.com if you need additional information or have any | |
| 23 | + * questions. | |
| 24 | + */ | |
| 25 | + | |
| 26 | +package java.security.interfaces; | |
| 27 | + | |
| 28 | +import java.math.BigInteger; | |
| 29 | +import java.security.spec.RSAOtherPrimeInfo; | |
| 30 | + | |
| 31 | +/** | |
| 32 | + * The interface to an RSA multi-prime private key, as defined in the | |
| 33 | + * PKCS#1 v2.1, using the <i>Chinese Remainder Theorem</i> | |
| 34 | + * (CRT) information values. | |
| 35 | + * | |
| 36 | + * @author Valerie Peng | |
| 37 | + * | |
| 38 | + * | |
| 39 | + * @see java.security.spec.RSAPrivateKeySpec | |
| 40 | + * @see java.security.spec.RSAMultiPrimePrivateCrtKeySpec | |
| 41 | + * @see RSAPrivateKey | |
| 42 | + * @see RSAPrivateCrtKey | |
| 43 | + * | |
| 44 | + * @since 1.4 | |
| 45 | + */ | |
| 46 | + | |
| 47 | +public interface RSAMultiPrimePrivateCrtKey extends RSAPrivateKey { | |
| 48 | + | |
| 49 | + static final long serialVersionUID = 618058533534628008L; | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * Returns the public exponent. | |
| 53 | + * | |
| 54 | + * @return the public exponent. | |
| 55 | + */ | |
| 56 | + public BigInteger getPublicExponent(); | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * Returns the primeP. | |
| 60 | + * | |
| 61 | + * @return the primeP. | |
| 62 | + */ | |
| 63 | + public BigInteger getPrimeP(); | |
| 64 | + | |
| 65 | + /** | |
| 66 | + * Returns the primeQ. | |
| 67 | + * | |
| 68 | + * @return the primeQ. | |
| 69 | + */ | |
| 70 | + public BigInteger getPrimeQ(); | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * Returns the primeExponentP. | |
| 74 | + * | |
| 75 | + * @return the primeExponentP. | |
| 76 | + */ | |
| 77 | + public BigInteger getPrimeExponentP(); | |
| 78 | + | |
| 79 | + /** | |
| 80 | + * Returns the primeExponentQ. | |
| 81 | + * | |
| 82 | + * @return the primeExponentQ. | |
| 83 | + */ | |
| 84 | + public BigInteger getPrimeExponentQ(); | |
| 85 | + | |
| 86 | + /** | |
| 87 | + * Returns the crtCoefficient. | |
| 88 | + * | |
| 89 | + * @return the crtCoefficient. | |
| 90 | + */ | |
| 91 | + public BigInteger getCrtCoefficient(); | |
| 92 | + | |
| 93 | + /** | |
| 94 | + * Returns the otherPrimeInfo or null if there are only | |
| 95 | + * two prime factors (p and q). | |
| 96 | + * | |
| 97 | + * @return the otherPrimeInfo. | |
| 98 | + */ | |
| 99 | + public RSAOtherPrimeInfo[] getOtherPrimeInfo(); | |
| 100 | +} | |
Binary file not shown.
| @@ -0,0 +1,85 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. | |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| 4 | + * | |
| 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 | |
| 7 | + * published by the Free Software Foundation. Oracle designates this | |
| 8 | + * particular file as subject to the "Classpath" exception as provided | |
| 9 | + * by Oracle in the LICENSE file that accompanied this code. | |
| 10 | + * | |
| 11 | + * This code is distributed in the hope that it will be useful, but WITHOUT | |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 | + * version 2 for more details (a copy is included in the LICENSE file that | |
| 15 | + * accompanied this code). | |
| 16 | + * | |
| 17 | + * You should have received a copy of the GNU General Public License version | |
| 18 | + * 2 along with this work; if not, write to the Free Software Foundation, | |
| 19 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 20 | + * | |
| 21 | + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| 22 | + * or visit www.oracle.com if you need additional information or have any | |
| 23 | + * questions. | |
| 24 | + */ | |
| 25 | + | |
| 26 | +package java.security.interfaces; | |
| 27 | + | |
| 28 | +import java.math.BigInteger; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * The interface to an RSA private key, as defined in the PKCS#1 standard, | |
| 32 | + * using the <i>Chinese Remainder Theorem</i> (CRT) information values. | |
| 33 | + * | |
| 34 | + * @author Jan Luehe | |
| 35 | + * | |
| 36 | + * | |
| 37 | + * @see RSAPrivateKey | |
| 38 | + */ | |
| 39 | + | |
| 40 | +public interface RSAPrivateCrtKey extends RSAPrivateKey { | |
| 41 | + | |
| 42 | + static final long serialVersionUID = -5682214253527700368L; | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * Returns the public exponent. | |
| 46 | + * | |
| 47 | + * @return the public exponent | |
| 48 | + */ | |
| 49 | + public BigInteger getPublicExponent(); | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * Returns the primeP. | |
| 53 | + | |
| 54 | + * @return the primeP | |
| 55 | + */ | |
| 56 | + public BigInteger getPrimeP(); | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * Returns the primeQ. | |
| 60 | + * | |
| 61 | + * @return the primeQ | |
| 62 | + */ | |
| 63 | + public BigInteger getPrimeQ(); | |
| 64 | + | |
| 65 | + /** | |
| 66 | + * Returns the primeExponentP. | |
| 67 | + * | |
| 68 | + * @return the primeExponentP | |
| 69 | + */ | |
| 70 | + public BigInteger getPrimeExponentP(); | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * Returns the primeExponentQ. | |
| 74 | + * | |
| 75 | + * @return the primeExponentQ | |
| 76 | + */ | |
| 77 | + public BigInteger getPrimeExponentQ(); | |
| 78 | + | |
| 79 | + /** | |
| 80 | + * Returns the crtCoefficient. | |
| 81 | + * | |
| 82 | + * @return the crtCoefficient | |
| 83 | + */ | |
| 84 | + public BigInteger getCrtCoefficient(); | |
| 85 | +} | |
Binary file not shown.
| @@ -0,0 +1,50 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. | |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| 4 | + * | |
| 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 | |
| 7 | + * published by the Free Software Foundation. Oracle designates this | |
| 8 | + * particular file as subject to the "Classpath" exception as provided | |
| 9 | + * by Oracle in the LICENSE file that accompanied this code. | |
| 10 | + * | |
| 11 | + * This code is distributed in the hope that it will be useful, but WITHOUT | |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 | + * version 2 for more details (a copy is included in the LICENSE file that | |
| 15 | + * accompanied this code). | |
| 16 | + * | |
| 17 | + * You should have received a copy of the GNU General Public License version | |
| 18 | + * 2 along with this work; if not, write to the Free Software Foundation, | |
| 19 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 20 | + * | |
| 21 | + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| 22 | + * or visit www.oracle.com if you need additional information or have any | |
| 23 | + * questions. | |
| 24 | + */ | |
| 25 | + | |
| 26 | +package java.security.interfaces; | |
| 27 | + | |
| 28 | +import java.math.BigInteger; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * The interface to an RSA private key. | |
| 32 | + * | |
| 33 | + * @author Jan Luehe | |
| 34 | + * | |
| 35 | + * | |
| 36 | + * @see RSAPrivateCrtKey | |
| 37 | + */ | |
| 38 | + | |
| 39 | +public interface RSAPrivateKey extends java.security.PrivateKey, RSAKey | |
| 40 | +{ | |
| 41 | + | |
| 42 | + static final long serialVersionUID = 5187144804936595022L; | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * Returns the private exponent. | |
| 46 | + * | |
| 47 | + * @return the private exponent | |
| 48 | + */ | |
| 49 | + public BigInteger getPrivateExponent(); | |
| 50 | +} | |
Binary file not shown.
| @@ -0,0 +1,47 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. | |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| 4 | + * | |
| 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 | |
| 7 | + * published by the Free Software Foundation. Oracle designates this | |
| 8 | + * particular file as subject to the "Classpath" exception as provided | |
| 9 | + * by Oracle in the LICENSE file that accompanied this code. | |
| 10 | + * | |
| 11 | + * This code is distributed in the hope that it will be useful, but WITHOUT | |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 | + * version 2 for more details (a copy is included in the LICENSE file that | |
| 15 | + * accompanied this code). | |
| 16 | + * | |
| 17 | + * You should have received a copy of the GNU General Public License version | |
| 18 | + * 2 along with this work; if not, write to the Free Software Foundation, | |
| 19 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 20 | + * | |
| 21 | + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| 22 | + * or visit www.oracle.com if you need additional information or have any | |
| 23 | + * questions. | |
| 24 | + */ | |
| 25 | + | |
| 26 | +package java.security.interfaces; | |
| 27 | + | |
| 28 | +import java.math.BigInteger; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * The interface to an RSA public key. | |
| 32 | + * | |
| 33 | + * @author Jan Luehe | |
| 34 | + * | |
| 35 | + */ | |
| 36 | + | |
| 37 | +public interface RSAPublicKey extends java.security.PublicKey, RSAKey | |
| 38 | +{ | |
| 39 | + static final long serialVersionUID = -8727434096241101194L; | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * Returns the public exponent. | |
| 43 | + * | |
| 44 | + * @return the public exponent | |
| 45 | + */ | |
| 46 | + public BigInteger getPublicExponent(); | |
| 47 | +} | |
| @@ -0,0 +1,20 @@ | ||
| 1 | +<../../../../../mkconfig | |
| 2 | + | |
| 3 | +TARG=\ | |
| 4 | + DSAKey.dis\ | |
| 5 | + DSAKeyPairGenerator.dis\ | |
| 6 | + DSAParams.dis\ | |
| 7 | + DSAPrivateKey.dis\ | |
| 8 | + DSAPublicKey.dis\ | |
| 9 | + ECKey.dis\ | |
| 10 | + ECPrivateKey.dis\ | |
| 11 | + ECPublicKey.dis\ | |
| 12 | + RSAKey.dis\ | |
| 13 | + RSAMultiPrimePrivateCrtKey.dis\ | |
| 14 | + RSAPrivateCrtKey.dis\ | |
| 15 | + RSAPrivateKey.dis\ | |
| 16 | + RSAPublicKey.dis\ | |
| 17 | + | |
| 18 | +DISBIN=$ROOT/java/dis/java/java/java/security/interfaces | |
| 19 | + | |
| 20 | +<$ROOT/mkfiles/mkjava | |
| @@ -0,0 +1,77 @@ | ||
| 1 | +<!-- | |
| 2 | + Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. | |
| 3 | + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| 4 | + | |
| 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 | |
| 7 | + published by the Free Software Foundation. Oracle designates this | |
| 8 | + particular file as subject to the "Classpath" exception as provided | |
| 9 | + by Oracle in the LICENSE file that accompanied this code. | |
| 10 | + | |
| 11 | + This code is distributed in the hope that it will be useful, but WITHOUT | |
| 12 | + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 | + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 | + version 2 for more details (a copy is included in the LICENSE file that | |
| 15 | + accompanied this code). | |
| 16 | + | |
| 17 | + You should have received a copy of the GNU General Public License version | |
| 18 | + 2 along with this work; if not, write to the Free Software Foundation, | |
| 19 | + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 20 | + | |
| 21 | + Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| 22 | + or visit www.oracle.com if you need additional information or have any | |
| 23 | + questions. | |
| 24 | +--> | |
| 25 | + | |
| 26 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | |
| 27 | +<html> | |
| 28 | +<body bgcolor="white"> | |
| 29 | + | |
| 30 | +Provides interfaces for generating RSA (Rivest, Shamir and | |
| 31 | +Adleman AsymmetricCipher algorithm) | |
| 32 | +keys as defined in the RSA Laboratory Technical Note | |
| 33 | +PKCS#1, and DSA (Digital Signature | |
| 34 | +Algorithm) keys as defined in NIST's FIPS-186. | |
| 35 | +<P> | |
| 36 | +Note that these interfaces are intended only for key | |
| 37 | +implementations whose key material is accessible and | |
| 38 | +available. These interfaces are not intended for key | |
| 39 | +implementations whose key material resides in | |
| 40 | +inaccessible, protected storage (such as in a | |
| 41 | +hardware device). | |
| 42 | +<P> | |
| 43 | +For more developer information on how to use these | |
| 44 | +interfaces, including information on how to design | |
| 45 | +<code>Key</code> classes for hardware devices, please refer | |
| 46 | +to these cryptographic provider developer guides: | |
| 47 | +<ul> | |
| 48 | + <li><a href= | |
| 49 | + "{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html"> | |
| 50 | + <b>How to Implement a Provider for the | |
| 51 | + Java<FONT SIZE=-2><SUP>TM</SUP></FONT> Cryptography Architecture | |
| 52 | + </b></a></li> | |
| 53 | +</ul> | |
| 54 | + | |
| 55 | +<h2>Package Specification</h2> | |
| 56 | + | |
| 57 | +<ul> | |
| 58 | + <li>PKCS #1: RSA Encryption Standard, Version 1.5, November 1993 </li> | |
| 59 | + <li>Federal Information Processing Standards Publication (FIPS PUB) 186: | |
| 60 | + Digital Signature Standard (DSS) </li> | |
| 61 | +</ul> | |
| 62 | + | |
| 63 | +<h2>Related Documentation</h2> | |
| 64 | + | |
| 65 | +For further documentation, please see: | |
| 66 | +<ul> | |
| 67 | + <li> | |
| 68 | + <a href= | |
| 69 | + "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html"> | |
| 70 | + <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT> | |
| 71 | + Cryptography Architecture API Specification and Reference | |
| 72 | + </b></a></li> | |
| 73 | +</ul> | |
| 74 | + | |
| 75 | +@since JDK1.1 | |
| 76 | +</body> | |
| 77 | +</html> | |