3002N/A * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 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 * 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 * 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. 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 0N/A * PKCS#1 RSA signatures with the various message digest algorithms. 0N/A * This file contains an abstract base class with all the logic plus 0N/A * a nested static class for each of the message digest algorithms 0N/A * (see end of the file). We support MD2, MD5, SHA-1, SHA-256, SHA-384, 0N/A * @author Andreas Sterbenz 0N/A // we sign an ASN.1 SEQUENCE of AlgorithmId and digest 3002N/A // it has the form 30:xx:30:xx:[digestOID]:05:00:04:xx:[digest] 0N/A // this means the encoded length is (8 + digestOID.length + digest.length) 0N/A // object identifier for the message digest algorithm used 0N/A // length of the encoded signature blob 0N/A // message digest implementation we use 0N/A // flag indicating whether the digest is reset 0N/A // private key, if initialized for signing 0N/A // public key, if initialized for verifying 0N/A * Construct a new RSASignature. Used by subclasses. 0N/A // initialize for verification. See JCA doc 0N/A // initialize for signing. See JCA doc 0N/A // initialize for signing. See JCA doc 0N/A * Init code common to sign and verify. 0N/A (
"Key is too short for this signature algorithm");
0N/A * Reset the message digest if it is not already reset. 0N/A * Return the message digest value. 0N/A // update the signature with the plaintext data. See JCA doc 0N/A // update the signature with the plaintext data. See JCA doc 0N/A // update the signature with the plaintext data. See JCA doc 0N/A // sign the data and return the signature. See JCA doc 0N/A // verify the data and return the result. See JCA doc 0N/A // occurs if the app has used the wrong RSA public key 0N/A // or if sigBytes is invalid 0N/A // return false rather than propagating the exception for 0N/A * Encode the digest, return the to-be-signed data. 0N/A * Also used by the PKCS#11 provider. 0N/A * Decode the signature data. Verify that the object identifier matches 0N/A * and return the message digest. 0N/A // set parameter, not supported. See JCA doc 0N/A // get parameter, not supported. See JCA doc 0N/A // Nested class for MD2withRSA signatures 0N/A // Nested class for MD5withRSA signatures 0N/A // Nested class for SHA1withRSA signatures 0N/A // Nested class for SHA256withRSA signatures 0N/A // Nested class for SHA384withRSA signatures 0N/A // Nested class for SHA512withRSA signatures