equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
37 |
37 |
38 /** |
38 /** |
39 * PKCS#1 RSA signatures with the various message digest algorithms. |
39 * PKCS#1 RSA signatures with the various message digest algorithms. |
40 * This file contains an abstract base class with all the logic plus |
40 * This file contains an abstract base class with all the logic plus |
41 * a nested static class for each of the message digest algorithms |
41 * a nested static class for each of the message digest algorithms |
42 * (see end of the file). We support MD2, MD5, SHA-1, SHA-256, SHA-384, |
42 * (see end of the file). We support MD2, MD5, SHA-1, SHA-224, SHA-256, |
43 * and SHA-512. |
43 * SHA-384, and SHA-512. |
44 * |
44 * |
45 * @since 1.5 |
45 * @since 1.5 |
46 * @author Andreas Sterbenz |
46 * @author Andreas Sterbenz |
47 */ |
47 */ |
48 public abstract class RSASignature extends SignatureSpi { |
48 public abstract class RSASignature extends SignatureSpi { |
274 public SHA1withRSA() { |
274 public SHA1withRSA() { |
275 super("SHA-1", AlgorithmId.SHA_oid, 7); |
275 super("SHA-1", AlgorithmId.SHA_oid, 7); |
276 } |
276 } |
277 } |
277 } |
278 |
278 |
|
279 // Nested class for SHA224withRSA signatures |
|
280 public static final class SHA224withRSA extends RSASignature { |
|
281 public SHA224withRSA() { |
|
282 super("SHA-224", AlgorithmId.SHA224_oid, 11); |
|
283 } |
|
284 } |
|
285 |
279 // Nested class for SHA256withRSA signatures |
286 // Nested class for SHA256withRSA signatures |
280 public static final class SHA256withRSA extends RSASignature { |
287 public static final class SHA256withRSA extends RSASignature { |
281 public SHA256withRSA() { |
288 public SHA256withRSA() { |
282 super("SHA-256", AlgorithmId.SHA256_oid, 11); |
289 super("SHA-256", AlgorithmId.SHA256_oid, 11); |
283 } |
290 } |